[R] reexpr transform nonumeric values to numeric

Noia Raindrops noia.raindrops at gmail.com
Tue Aug 21 12:32:54 CEST 2012


Use backreference:

as.numeric(gsub("^(.*)-$", "-\\1", as.character(temp)))

-- 
Noia Raindrops
noia.raindrops at gmail.com




More information about the R-help mailing list