[R] Simple numeric "as.is" question

Timur Elzhov Timur.Elzhov at jinr.ru
Mon Mar 15 16:30:06 CET 2004


On Mon, Mar 15, 2004 at 09:04:05AM -0500, 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 
> file.  How do make this numeric?  Thanks, J.

x <- read.table("clipboard", header=F)
x <- as.data.frame(lapply(x, as.numeric))

--
WBR,
Timur




More information about the R-help mailing list