I have a data frame in R where all the variables are character in nature. kindly let know how I can transform these character variable into say "numeric","Categorical","continuous" etc.Please provide me with the proper syntax. Thank you in advance. -- View this message in context: http://www.nabble.com/Transformation-of-Variables-tp22032424p22032424.html Sent from the R help mailing list archive at Nabble.com.
There are a series of coercion functions, all beginning with "as." which are designed to return (when possible) objects of specified types. Since you offer three examples, only one of which I recognize as a valid R type, I am wondering what R text you have been using? -- David Winsemius On Feb 16, 2009, at 2:00 AM, Arup wrote:> > I have a data frame in R where all the variables are character in > nature. > kindly let know how I can transform these character variable into say > "numeric","Categorical","continuous" etc.Please provide me with the > proper > syntax. Thank you in advance. > -- > View this message in context: http://www.nabble.com/Transformation-of-Variables-tp22032424p22032424.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.
It would be useful to have some sample input data and then what you expect as output. You can always convert the characters to factors and then use the integer values assigned. On Mon, Feb 16, 2009 at 2:00 AM, Arup <arup.pramanik27 at gmail.com> wrote:> > I have a data frame in R where all the variables are character in nature. > kindly let know how I can transform these character variable into say > "numeric","Categorical","continuous" etc.Please provide me with the proper > syntax. Thank you in advance. > -- > View this message in context: http://www.nabble.com/Transformation-of-Variables-tp22032424p22032424.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. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve?