Dear All,

 

I am lost about the following. I have got a large dataframe (largeset) with in 
the first column identification numbers as factors

 

largeset$ID

p000345

p000356

p000569

etc

--

 

in order to use them to merge with another dataframe with numerical values 
(000345, 000356) I want to convert them to numerical.

 

>as.numeric(as.character(largeset$ID)) gives NA's

 

>as.numeric(strsplit(as.character(largeset[,1]), "p")) also fails:

 

Error in as.double.default(strsplit(as.character(largeset[, 1]), "p")) : 
        unimplemented type 'character' in 'asReal'



Any suggestions would be very appreciated

Marco
        [[alternative HTML version deleted]]

______________________________________________
[email protected] 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.

Reply via email to