Re: [R] How to change the class of data?

From: Frankg <riadh_aloui_at_hotmail.com>
Date: Wed, 11 Jun 2008 23:58:40 -0700 (PDT)

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.

______________________________________________
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.
Received on Thu 12 Jun 2008 - 07:01:12 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 12 Jun 2008 - 07:30:45 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive