[R] recoding variables

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Thu Mar 11 16:15:48 CET 2004



Shayna Strom wrote:

> Hi,
> 
> I was hoping someone could help me.  I am a graduate student new to using R, and I'm trying to figure out how to recode a continuous variable to make it into an ordinal variable with 3 categories.  I literally have no idea how to proceed--could anyone possibly advise me?  Please copy me on any responses, as I have just subscribed to the R-help email list but don't know whether the subscription has gone through yet.
> 
> Thanks so much-
> Shayna
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

See ?ordered.

x <- rep(runif(3), 10)
xord <- ordered(x)




More information about the R-help mailing list