[R] How to change the class of data?

Frankg riadh_aloui at hotmail.com
Thu Jun 12 08:58:40 CEST 2008


When you have a data X with a class factor, you can transform it to numeric
as

y<-as.numeric(X)

to transform it to a factor again use

y<-as.factor(X)


-- 
View this message in context: http://www.nabble.com/How-to-change-the-class-of-data--tp17793351p17793713.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list