[R] How to turn a string into a variable name ?

From: Ng Stanley <stanleyngkl_at_gmail.com>
Date: Fri, 14 Mar 2008 11:27:24 +0800


For example,

natural_nums <- 1:10
even_nums <- seq(2,10, by = 2)
types <- c("natural_nums", "even_nums")

What functions can be performed on types[1] to turn it into a variable name and not a string ?

        [[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. Received on Fri 14 Mar 2008 - 03:32:51 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 Fri 14 Mar 2008 - 05:30:21 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