Skip to content
Prev 338306 / 398500 Next

numeric to factor via lookup table

Note that your example may be misleadingly simple, so I made it a bit
more complicated.

The key is ?match
[1] j i f f a
Levels: a b c d e f g h i j

## Note that you may have to take care if there are NA's in values.
Read ?match carefully if this might happen.

Cheers,
Bert
Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
H. Gilbert Welch
On Fri, Mar 28, 2014 at 1:38 PM, Jonathan Greenberg <jgrn at illinois.edu> wrote: