[R] hist(list)?

Paul Kienzle pkienzle at kienzle.powernet.co.uk
Wed Mar 17 12:20:10 CET 1999

It seems that the following should work:

> x<-read.table('1A.tab',header=T,skip=1);
> mode(x[1])
[1] "list"
> x[1]
R1-00 0.0295
R1-01 0.0283
R1-02 0.0145
R1-03 0.0235
R1-04 0.0339
R1-05 0.0239
R1-06 0.0414
R1-07 0.0259
> hist(x[1])
Error: hist: x must be numeric
> as.numeric(x[1])
Error: (list) object cannot be coerced to vector type 14

I've worked around the problem by removing the is.numeric() test from
src/library/base/R/hist.R and in happily produces a histogram for me.
Is there a better way of letting R know that it is working with a list
of numerics only?

Paul Kienzle
pkienzle at cs.indiana.edu
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list