Dear R-expert, For histogram function, can we get the table of bin and frequency like in excel, together with the histogram? Therefore, we can check the number of data included. Thank you so much for your attention and help. ____________________________________________________________________________________ [[elided Yahoo spam]]
On 9/05/2008, at 12:04 PM, Roslina Zakaria wrote:> Dear R-expert, > For histogram function, can we get the table of bin and frequency > like in excel, together with the histogram? > Therefore, we can check the number of data included. > Thank you so much for your attention and help.?hist Look at the ``Value'' material. cheers, Rolf Turner ###################################################################### Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
On Thu, 8 May 2008, Roslina Zakaria wrote:> Dear R-expert, > For histogram function, can we get the table of bin and frequency like in excel, together with the histogram? > Therefore, we can check the number of data included. > Thank you so much for your attention and help. >Easy one: just use the argument plot=FALSE and hist will produce the counts etc for you David Scott _________________________________________________________________ David Scott Department of Statistics, Tamaki Campus The University of Auckland, PB 92019 Auckland 1142, NEW ZEALAND Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000 Email: d.scott at auckland.ac.nz Graduate Officer, Department of Statistics Director of Consulting, Department of Statistics
Hi r-expert, I would like to plot histogram using frequency not density. But I got the following warning. ?obs.hist <- hist(jan_data2[,4],right=FALSE,breaks=c(0,5,10,15,20,100),freq=TRUE, +???????????? xlab="Rain amt (mm)",ylim=c(0,3000), +???????????? main="Frequency of observed, Jan (1901-1990), Pooraka") Warning message: In plot.histogram(r, freq = freq1, col = col, border = border, angle = angle,? : ? the AREAS in the plot are wrong -- rather use freq=FALSE I don't really understand the warning message and hope anybody can help me. Thanks in advance for your help.??
Hello everyone, I am trying to plot a histogram from the following code: dat<-read.table(file="C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt",header=T,row.names=1) file.show(file="C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt") x<-dat[2,23:46] y=mean(x,trim=0,na.rm=T) colMeans(dat[2,23:46]) boxplot(dat[2,23:46]) hist(dat[2,23:46]) The box plot is fine but the histogram keeps giving me the error that x must be numeric.I am not sure what is wrong here with the instructions for the histogram plot. Any help would be appreciated Paul [[alternative HTML version deleted]]
Paul Adams wrote:> Hello everyone, > I am trying to plot a histogram from the following code: > dat<-read.table(file="C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt",header=T,row.names=1) > file.show(file="C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt") > x<-dat[2,23:46] > y=mean(x,trim=0,na.rm=T) > colMeans(dat[2,23:46]) > boxplot(dat[2,23:46]) > hist(dat[2,23:46])Check what the class of your object is class(dat[2, 23:46]) may be a data.frame. If so, you can try to convert accordingly (see ?as.numeric) Erik
Hi, please someone correct me, but On 13/06/2008, 07:21, pma3622 at yahoo.com wrote:> dat<-read.table(file="C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt",header=T,row.names=1)Check mode and class of dat. read.table provided you with a dataframe of, essentially, string data. You have to apply as.numeric where it fits.> x<-dat[2,23:46]^ most probably here. Regards Lars p.s. Your code is awfully to read, please add some spaces where appropriate. -- Lars Fischer tel: +49 (0)6151 16-2889 Technische Universit?t Darmstadt Fachbereich Informatik/ FG Sicherheit in der Informationstechnik PGP FPR: A197 CBE1 91FC 0CE3 A71D 77F2 1094 CB6E CEE3 7111
Hi, please someone correct me, but On 13/06/2008, 07:21, pma3622 at yahoo.com wrote:> dat<-read.table(file="C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt",header=T,row.names=1)Check mode and class of dat. read.table provided you with a dataframe of, essentially, string data. You have to apply as.numeric where it fits.> x<-dat[2,23:46]^ most probably here. Regards Lars p.s. Your code is awfully to read, please add some spaces where appropriate. -- Lars Fischer tel: +49 (0)6151 16-2889 Technische Universit?t Darmstadt Fachbereich Informatik/ FG Sicherheit in der Informationstechnik PGP FPR: A197 CBE1 91FC 0CE3 A71D 77F2 1094 CB6E CEE3 7111