read.table produces a data.frame (a special list) even when you have only one column. Try y<-as.numeric(x[[1]])
On Wed, Aug 19, 2009 at 3:59 PM, Bogdan Tanasa <tan...@gmail.com> wrote: > Hi, and my apologies for the following very naive question : I would like > to > read a column of numbers in R and plot a histogram. > > eg : > > x<-read.table("txSTART"); > y<-as.numeric(x); > > and I do obtain the error : Error: (list) object cannot be coerced to type > 'double'. Please could you let me know the way to fix it. > > thanks, > > bogdan > <r-help@r-project.org> > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@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. > -- Jun Shen PhD PK/PD Scientist BioPharma Services Millipore Corporation 15 Research Park Dr. St Charles, MO 63304 Direct: 636-720-1589 [[alternative HTML version deleted]] ______________________________________________ R-help@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.