[R] Simple numeric "as.is" question
Thomas Petzoldt
thpe at hhbio.wasser.tu-dresden.de
Mon Mar 15 17:05:01 CET 2004
Janet Gannon wrote:
> I am reading a list of numbers from my clipboard, and have been
> successful, except I can't make a histogram as R doesn't recognize my
> variable as numeric. I know I need to use "as.is", but the specifics
> escape me.
> I have used x<-read.table("clipboard", header=F) to import from a txt
In normal circumstances, your example works, but sometimes you need
special options, e.g sep="\t" if you have missing values or dec="," in
countries with comma as decimal delimiter. Another possibility is, that
read.table has converted your data into factors, then convert them back,
via:
x$V1 <- as.numeric(as.character(x$V1))
etc...
For more options please read the R Data Import/Export manual.
Thomas
More information about the R-help
mailing list