RE: [R] Histogram

From: Neuro LeSuperHéros <neuro3000_at_hotmail.com>
Date: Thu 21 Apr 2005 - 03:04:08 EST


As Achim said, I would use a barplot instead of an hist.

Here's how I would do it:

vect<-c("a","b","a","b","b","b","a","a","a")

a<-length(vect[vect=="a"])
b<-length(vect[vect=="b"])
barplot(c(a,b),names.arg=(c("A","B")))

Neuro the Super Hero

>From: "Mag. Ferri Leberl" <ferri.leberl@gmx.at>
>Reply-To: ferri.leberl@gmx.at
>To: r-help@stat.math.ethz.ch
>Subject: [R] Histogram
>Date: Wed, 20 Apr 2005 17:37:04 +0200
>
>Dear everybody!
>I am analysing data from an enquette. The answers are either A or B. How
>can I
>draw a histogram without transforming the data from characters to numbers?
>If
>the data are saved in a list M, hist(M[,1]) returns:
>
>Error in hist.default(M[, 1]) : `x' must be numeric
>Execution halted
>
>Thank you in advance!
>
>______________________________________________
>R-help@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



R-help@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 Received on Thu Apr 21 08:26:06 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:20 EST