Skip to content

Recategorizing Nominal variable

4 messages · Michael Leitson, R. Michael Weylandt, Bert Gunter +1 more

#
On Tue, Sep 25, 2012 at 2:22 PM, Michael Leitson
<Michael.Leitson at wellstar.org> wrote:
Try something like

as.numeric(factor(x))

This works because factors are internally coded as one integer per
unique level.

Cheers,
Michael
#
Unless you have good reason and know what you're doing, **don't do
this!** It is just asking for trouble.

... and yes, it is easy. Have you gone through the "Intro to R"
tutorial that I believe would provide you the information to do this?

Cheers,
Bert

On Tue, Sep 25, 2012 at 6:22 AM, Michael Leitson
<Michael.Leitson at wellstar.org> wrote: