Re: [Rd] How to set values

From: jorgeA <thetroopermail_at_gmail.com>
Date: Tue, 27 Sep 2011 11:38:13 -0700 (PDT)

I'm not sure if I have understood your question, so I will put two possibilities:

1 - You have a variable called X ="0" and a variable called Y = "12" and want that to be numeric. You can do this:

X <- as.numeric(X)
Y <- as.numeric(Y)

2 - You have a variable called XY = "0","12" and want to make a list of numeric. Then you can do something like this:

XY <- as.numeric(unlist(strsplit(XY, ",")))

I hope this helps,

Best regards
Jorge Aikes Junior

--
View this message in context: http://r.789695.n4.nabble.com/How-to-set-values-tp3823290p3848526.html
Sent from the R devel mailing list archive at Nabble.com.

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed 28 Sep 2011 - 08:28:08 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Wed 28 Sep 2011 - 11:50:35 GMT.

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

list of date sections of archive