Re: [R] barplot with a probability density curve

2010-03-15 Thread Olga Lyashevska
Dear All, Thanks everyone for your kind responses. Now I understand what is gong on! I guess that the question asked is wrong in the first place. As there is a categorical list of groups and their values (a range of pipe diameters and a flow for each diameter), and a barplot would be a sui

Re: [R] barplot with a probability density curve

2010-03-14 Thread Jim Lemon
On 03/15/2010 08:32 AM, Olga Lyashevska wrote: Dear all, I am making a barplot as following: barplot(c(1,2,3,5,2,3,1),names.arg=c("100","200","300","400","500","600","700"),xlab="diameter",ylab="flow",main="some title",space=0.1) I am also trying to add a probability density curve, however us

Re: [R] barplot with a probability density curve

2010-03-14 Thread Rolf Turner
On 15/03/2010, at 3:37 PM, S Ellison wrote: > I begin to think that R needs a _mis_fortunes package... I am tempted to nominate *that* as a fortune! :-) cheers, Rolf Turner ## Attention:\ This e-mail m

Re: [R] barplot with a probability density curve

2010-03-14 Thread S Ellison
I begin to think that R needs a _mis_fortunes package... Steve E >>> Rolf Turner 03/15/10 2:21 AM >>> On 15/03/2010, at 3:07 PM, S Ellison wrote (in response to a very confused question about superimposing density curves on barplots): > So the bad news is that not a lot of what you'

Re: [R] barplot with a probability density curve

2010-03-14 Thread Rolf Turner
On 15/03/2010, at 3:07 PM, S Ellison wrote (in response to a very confused question about superimposing density curves on barplots): > So the bad news is that not a lot of what you're doing is right. Sounds like a fortune to me! :-) cheers, Rolf Tur

Re: [R] barplot with a probability density curve

2010-03-14 Thread S Ellison
You have three problems: i) Barplot's plot locations are not at 100-700 in your picture. ii) density applied to your bar hights will produce the density as if those are x locations, not heights. iii) density's height is scaled to unit area and not the height of your bars. And a statistical issue:

Re: [R] barplot with a probability density curve

2010-03-14 Thread milton ruser
Hi Olga, may be you can work around with the suggestions below, while other provide the best solution for your: barplot(c(1,2,3,5,2,3,1),names.arg=c("100","200","300","400","500","600","700"), xlab="diameter",ylab="flow",main="some title",space=0.1) lines(lowess(c(1,2,3,5,2,3,1),f=1), type="b",

[R] barplot with a probability density curve

2010-03-14 Thread Olga Lyashevska
Dear all, I am making a barplot as following: barplot(c(1,2,3,5,2,3,1),names.arg=c("100","200","300","400","500","600","700"),xlab="diameter",ylab="flow",main="some title",space=0.1) I am also trying to add a probability density curve, however using lines(density(c(1,2,3,5,2,3,1))) does not gi