you may want to look at "recode" command in car package.
Again as Bert said it depends on what are you trying to achieve.

Best Regards,


Bhupendrasinh Thakre

*Disclaimer :*

The information contained in this communication is confidential and may be
legally privileged. It is intended solely for the use of the individual or
entity to whom it is adressed. If you are not the intended recipient you
are hereby (a) notified that any disclosure, copying, distribution or
taking any action with respect to the content of this information is
strictly prohibited and may be unlawful, and (b) kindly requested to inform
the sender immediately and destroy any copies.



On Tue, Sep 25, 2012 at 10:28 AM, R. Michael Weylandt <
michael.weylandt@gmail.com> wrote:

> On Tue, Sep 25, 2012 at 2:22 PM, Michael Leitson
> <Michael.Leitson@wellstar.org> wrote:
> > Hello,
> >
> > I would like to take a data set of doctors, and recategorize them into
> > numbers.
> >
> > For example,
> >
> > John Doe would be assigned as 1
> > Jane Doe would be assigned as 2
> >
> > Does anyone know how to do this in R? It seems quite easy, yet I cannot
> > find the code.
> >
> > Thank you,
> >
> >
>
> Try something like
>
> as.numeric(factor(x))
>
> This works because factors are internally coded as one integer per
> unique level.
>
> Cheers,
> Michael
>
> > Michael Leitson
> >
> > Research Intern
> > MSAS Candidate
> > Michael.Leitson@wellstar.org
> >
> >
> > ________________________________________________
> > This email and any files transmitted with it may contain
> > confidential and /or proprietary information in the possession
> > of WellStar Health System, Inc. ("WellStar") and is intended
> > only for the individual or entity to whom addressed. This email
> > may contain information that is held to be privileged, confidential
> > and exempt from disclosure under applicable law. If the reader
> > of this message is not the intended recipient, you are hereby
> > notified that any unauthorized access, dissemination, distribution
> > or copying of any information from this email is strictly prohibited,
> > and may subject you to criminal and/or civil liability. If you have
> > received this email in error, please notify the sender by reply email
> > and then delete this email and its attachments from your computer.
> > - Thank you.
> >
> >
> >         [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]


