Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9246717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:33:25+00:00 2026-06-18T09:33:25+00:00

The following reproducible example creates a conditional density plot depicting change by aspect. I’ve

  • 0

The following reproducible example creates a conditional density plot depicting change by aspect. I’ve included NoData in the example because my original dataset also has NoData.

aspect = c("N", "N", "E", "S", "SW", "SW", "E", "W", "N", "N")
change = c(-1, NA, 1, NA, 1, 1, -1, 1, -1, NA)
mydata = data.frame(aspect,change)

x = factor(mydata$change)

cdplot(x~mydata$aspect)

enter image description here

Related Questions:

  • How do I replace the numerical values on the X-axis with the
    associated text values (e.g. N, SW, etc)?
  • Is it possible to have control over the order of text values on the
    X-axis? I believe, by default, the values on the X-axis correspond
    to the alphabetically ordered text values in “aspect”.
  • How do I replace “NA” on the X-axis with “No Change”?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:33:26+00:00Added an answer on June 18, 2026 at 9:33 am

    just to show what @Roland said in the comments, you use the function in a wrong manner.

    aspect = c("N", "N", "E", "S", "SW", "SW", "E", "W", "N", "N")
    change = sample(rep(c(-1,1,NA), each = 100),100,replace=T)
    mydata = data.frame(aspect,change,stringsAsFactors=T)
    str(mydata)
    'data.frame':   100 obs. of  2 variables:
     $aspect: Factor
    $change: num 
    h <- cdplot(aspect~change, data = mydata)
    

    enter image description here

    and now h contains the conditional density functions over the levels of aspect.

    str(h)
    List of 4
     $ E :function (v)  
     $ N :function (v)  
     $ S :function (v)  
     $ SW:function (v)  
    

    e.g

    h$E(-Inf)
    [1] 0.21875
    h$E(Inf)
    [1] 0.25
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using xtsExtra to plot two xts objects. Consider the following call to plot.xts:
following situation: <body> <div style=position:fixed; width:100%>[place holder for header]</div> <div style=position:relative;width:100%;margin-top:100px>[content]</div> </body> I need
Following code produces a nested array as a result for keys containing three items:
Following code takes like 2500 milliseconds on an i7-*3.4 GHz windows-7 64-bit computer to
Following are the simple statements in the irb shell. What does nil in the
Following code worked fine abstract class FunctionRunnable<V> implements Runnable { protected abstract V calculate();
Following chunk html code works as expected: <iframe src=http://www.amazon.com/></iframe> But when trying embed inner
Following leads in this thread and others, I've set up a code block where
Following is the Play 2 app, https://github.com/playframework/Play20/tree/master/samples/java/forms Which portrays Dynamic form binding where form
Following on from my previous question: Simple inner join in linq How would I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.