Re: [R] how to add frequencies to barplot

2010-11-23 Thread Juliet Hannah
Also check out the following post: http://permalink.gmane.org/gmane.comp.lang.r.general/210897 On Sat, Nov 20, 2010 at 4:32 PM, casperyc caspe...@hotmail.co.uk wrote: Hi, I have count data x2=rep(c(0:3),c(13,80,60,27)) x2  0  1  2  3 13 80 60 27 I want to graph to be ploted as

Re: [R] how to add frequencies to barplot

2010-11-23 Thread Greg Snow
greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of casperyc Sent: Saturday, November 20, 2010 2:32 PM To: r-help@r-project.org Subject: [R] how to add frequencies to barplot Hi, I have count

[R] how to add frequencies to barplot

2010-11-20 Thread casperyc
Hi, I have count data x2=rep(c(0:3),c(13,80,60,27)) x2 0 1 2 3 13 80 60 27 I want to graph to be ploted as barplot(table(x2),density=4) how do I add relative frequency to it, like in hist(x2,labels=T) above the 'bar's Thanks. casper -- View this message in context:

Re: [R] how to add frequencies to barplot

2010-11-20 Thread Remko Duursma
Hi Casper, try this: b - barplot(table(x2),density=4, ylim=c(0,100)) tx2 - table(x2) text(b,tx2+5, as.character(tx2)) greetings, Remko -- View this message in context: http://r.789695.n4.nabble.com/how-to-add-frequencies-to-barplot-tp3051923p3052067.html Sent from the R help mailing list