[R] Equivalent of chartr to numeric

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


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?

Alberto Monteiro



More information about the R-help mailing list