[R] reexpr transform nonumeric values to numeric
PIKAL Petr
petr.pikal at precheza.cz
Tue Aug 21 13:04:47 CEST 2012
Thank you
I knew that somebody can use power of gsub better than myself.
Petr
> -----Original Message-----
> From: Noia Raindrops [mailto:noia.raindrops at gmail.com]
> Sent: Tuesday, August 21, 2012 12:33 PM
> To: PIKAL Petr
> Cc: r-help
> Subject: Re: [R] reexpr transform nonumeric values to numeric
>
> Use backreference:
>
> as.numeric(gsub("^(.*)-$", "-\\1", as.character(temp)))
>
> --
> Noia Raindrops
> noia.raindrops at gmail.com
>
>
More information about the R-help
mailing list