[R] Histogram

Peter Dalgaard p.dalgaard at biostat.ku.dk
Wed Apr 20 18:10:36 CEST 2005


"Mag. Ferri Leberl" <ferri.leberl at gmx.at> writes:

> 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!

You can't. Histograms are density estimates for continuous outcomes.

You can do a barplot, however.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list