[R] Numeric Class to Nominal class

Nordlund, Dan (DSHS/RDA) NordlDJ at dshs.wa.gov
Wed Mar 13 17:42:23 CET 2013


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Nicolás Sánchez
> Sent: Wednesday, March 13, 2013 9:30 AM
> To: r-help at r-project.org
> Subject: [R] Numeric Class to Nominal class
> 
> Hello everybody!
> 
> I have a question. I am working with R and I am loading a .txt from my
> computer. This file contains a set of features from patients with
> numerical
> values and the score, that determines the gravity of the disease( from
> 0 to
> 3). Due to I want to obtain a classification of my patients using
> SVM,neural networks or C.4.5, I think I need to "convert" the numeric
> class
> to nominal class, not?
> I have thought to make a easy modification. The score is from 0 to 3.
> So, I
> have converted "0" to nominal class "g0", and successively. But I am
> not
> sure if this is the correct way to do it. Any information is welcome.
> 
> Thanks!
> 

I would convert it to an ordered factor.  See ?factor


Hope this is helpful,

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204




More information about the R-help mailing list