[R] nominal to numeric function

Daniel Malter daniel at umd.edu
Wed Aug 12 18:05:30 CEST 2009

Hi you can use newvariable=as.numeric(variablename). This converts your
factors into numeric variables, but not always with the desired result. So
make sure that you check whether "newvariable" gives you what you want.
Otherwise recoding by hand is indicated.


Noah Silverman-3 wrote:
> Hi,
> I'm training an SVM (C-classification from e1071 library)
> Some of the variables in my data set are nominal.  Is there some 
> easy/automatic way to convert them to numerical representations?
> Thanks,
> -N
> ______________________________________________
> R-help at 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.

View this message in context: http://www.nabble.com/nominal-to-numeric-function-tp24930466p24939723.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list