[R] Variable name in a String

From: R_Learner <sschiang8_at_gmail.com>
Date: Wed, 30 Jul 2008 10:22:13 -0700 (PDT)

Hi all,
  I have this string "year" and integer 2008 (both are inputs from the user), and I would like to make a variable called "year2008" that will store a vector of numbers. Does anyone know how to do this?

  Also, if the user later input "year" and "2008", how do I treat this as a variable; how can I access the variable year2008 using the string paste("year","2008",sep="")?

Thanks so much!

-- 
View this message in context: http://www.nabble.com/Variable-name-in-a-String-tp18738356p18738356.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 Wed 30 Jul 2008 - 18:46:34 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 Wed 30 Jul 2008 - 19:33:00 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