[R] covert categoral data into number
Jeff Newmiller
jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Sun Jun 13 09:06:54 CEST 2021
factor( DF$numbers
, levels=1:4
, labels=c( "bottom", "middle", "high" , "top" )
)
On June 12, 2021 8:24:31 AM PDT, Jxay Ljj <ljjjxay using gmail.com> wrote:
>Hi
>
>I would like to convert numbers into different categorical levels . For
>example,
>
>In one of column of a dataframe, there are numbers: 1,2,3, 4. How can I
>cover them into "bottom", "middle", "high" , "top" in R codes?
>
>Thanks,
>JL
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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.
--
Sent from my phone. Please excuse my brevity.
More information about the R-help
mailing list