MAPK MAPK - 1 year ago 64
R Question

How to plot range of values in R

I have this Rdata:


I want to plot a density graph something like this, where I can see range of values in
column spanning for each
items. Also, my X-axis should be between -2 to 2 and Y-axis should have cutoff items only (not the numerical values).

This is what I tried, but all I can see is dark lines. Is there any other method to do this?

p <- ggplot(mymat, aes(x=as.numeric(want.IBS), fill=cutoff)) #as suggested
p <- p + geom_density(alpha=0.5)
p <- p + xlab ("IBD") + ylab("cutoff")
p <- p + theme_bw()

Answer Source
dd<-melt(mm, id.vars=c("cutoff"))
ggplot(dd, aes(x= as.numeric(value), fill=cutoff))+
   +xlab ("IBD") + ylab("cutoff")+theme_bw()

enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download