[R] relative frequency plot using ggplot or other function

2012-01-12 Thread Mary Kindall
Hi I have a data frame in the following form. There are two groups and for each 'width' relative frequency for group1 and group2 is given. How to plot this in R using ggplot or other package. Width relativeFrequency1 relativeFrequency2 1 100 0.0006388783 0.02265428 2 200

Re: [R] relative frequency plot using ggplot or other function

2012-01-12 Thread Justin Haynes
On Thu 12 Jan 2012 09:02:27 AM PST, Mary Kindall wrote: Hi I have a data frame in the following form. There are two groups and for each 'width' relative frequency for group1 and group2 is given. How to plot this in R using ggplot or other package. Width relativeFrequency1

Re: [R] relative frequency plot using ggplot or other function

2012-01-12 Thread Mary Kindall
Hi this is exactly what i am looking for but I do not like to draw as histogram instead I want two separate plot for this data. Something like the ones shown in the following link. Please disregard the legends of the following fig.

Re: [R] relative frequency plot using ggplot or other function

2012-01-12 Thread Justin Haynes
ggplot(dat.melt,aes(x=width,y=value,fill=variable,colour=variable))+geom_density(stat='identity',alpha=0.5) the fill and colour variables can be removed if you want. or ggplot(dat.melt,aes(x=width,y=value,fill=variable))+geom_density(stat='identity',alpha=0.5)+facet_wrap(~variable,ncol=1) same