[R] Newbie Question About Histograms

Peter Alspach PAlspach at hortresearch.co.nz
Wed Jan 28 22:10:38 CET 2009


Kia ora Ivan

I think you might want a barplot.

?hist

under 'See Also:' states:

     Typical plots with vertical bars are _not_ histograms.  Consider
     'barplot' or 'plot(*, type = "h")' for such bar plots.
 
[The online help in R is good.]

HTH ....

Peter Alspach

> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] On Behalf Of pfc_ivan
> Sent: Thursday, 29 January 2009 9:04 a.m.
> To: r-help at r-project.org
> Subject: [R] Newbie Question About Histograms
> 
> 
> Hello everyone. Just have a question , cant figure out how to 
> make this histogram. 
> 
> I have this table, that i stored in a variable name 
> new.data2. Table looks like this
> 
> Year GeoArea SmpNo Month Gear Maturity Length Age YearC
> 1989       1   362    10   22        1    225   1  1988
> 1991       1   267    10   10        1    191   1  1990
> 1991       1   267    10   10        1    202   1  1990
> 1992       1   305    10    8        1    162   1  1991
> 1992       1   305    10    8        1    165   1  1991
> 1992       1   305    10    8        1    166   1  1991
> 1992       1   305    10    8        1    167   1  1991
> 1992       1   305    10    8        1    167   1  1991
> 1992       1   305    10    8        1    169   1  1991
> 1992       1   305    10    8        1    170   1  1991
> 
> Now I need to make a histogram of Length vs YearC. I would 
> guess that Length would be on the Y-axis and YearC variable 
> would be on X-axis. I have tried many different combinations 
> with command 'hist' but im always getting error " 'x' must be 
> numeric " ... I think im getting that error because of the 
> header which is not numeric. Any help would be appreciated. 
> Thanks guys. 
> 
> Ivan.
> --
> View this message in context: 
> http://www.nabble.com/Newbie-Question-About-Histograms-tp21713
> 626p21713626.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 

The contents of this e-mail are confidential and may be subject to legal privilege.
 If you are not the intended recipient you must not use, disseminate, distribute or
 reproduce all or any part of this e-mail or attachments.  If you have received this
 e-mail in error, please notify the sender and delete all material pertaining to this
 e-mail.  Any opinion or views expressed in this e-mail are those of the individual
 sender and may not represent those of The New Zealand Institute for Plant and
 Food Research Limited.




More information about the R-help mailing list