[R] Equivalent of chartr to numeric

ALBERTO VIEIRA FERREIRA MONTEIRO albmont at centroin.com.br
Thu Jul 17 21:28:33 CEST 2014


Replying to self:
>
> Is there any equivalent to chartr for numeric values?
>
> Meaning, something like:
>
> numerictr(c(-1, 42, 666), 1:3, numeric.stuff)
>
> that replaces in "numeric.stuff" (a vector, matrix, etc) all instances
> of -1 for 1, 42 for 2 and 666 for 3?
>
match does it. Sorry to ask.

Alberto Monteiro



More information about the R-help mailing list