[R] Non-Numeric Histograms

Uwe Ligges ligges at statistik.uni-dortmund.de
Sat Jul 8 16:53:10 CEST 2006


justin rapp wrote:
> I have a dataset with a variable that is non-numeric.  I was wondering
> if there is an easy way in R to create a bar graph that will tell me
> how many of each level of this non-numeric variable are in the overall
> dataset.
> 
> Specifically, if my variable is LETTER, and I have A, B,C, D, E, F and
> I want to find out how many of each letter there are, what is the
> easiest way to do this in R and use the information to make a plot?


  barplot(table(c("A", "A", "B")))

Uwe Ligges


> jdr
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



More information about the R-help mailing list