song song
2010-Apr-29 21:05 UTC
[R] Is it possible to transform a factor to a number like this way?
such a factor as a=as.factor(c(1.23, 4.56, 7.89)) and I want to get this vector: c(1.23, 4.56, 7.89). Thanks [[alternative HTML version deleted]]
Erik Iverson
2010-Apr-29 21:08 UTC
[R] Is it possible to transform a factor to a number like this way?
song song wrote:> such a factor as a=as.factor(c(1.23, 4.56, 7.89)) and I want to get this > vector: c(1.23, 4.56, 7.89).You're told how to do this in the help page for ?factor. See the Warning section.
Greg Snow
2010-Apr-30 18:07 UTC
[R] Is it possible to transform a factor to a number like this way?
This is a Frequently Asked Question, so frequently in fact that it is found in the FAQ along with a couple of answers and discussion of their merits. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of song song > Sent: Thursday, April 29, 2010 3:06 PM > To: r-help at r-project.org > Subject: [R] Is it possible to transform a factor to a number like this > way? > > such a factor as a=as.factor(c(1.23, 4.56, 7.89)) and I want to get > this > vector: c(1.23, 4.56, 7.89). > Thanks > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.
Seemingly Similar Threads
- how to rewrite this for loops in matrix form without loop
- how to initial a list to store data result?
- ask a question about data sets element
- how to remove the names in the list result
- creating a scale (factor) based on a continuous variable nested within levels of factor