[R] Converting Character Strings into Object Names

White.Denis@epamail.epa.gov White.Denis at epamail.epa.gov
Fri May 24 22:36:24 CEST 2002

> Is there a function to convert character strings to object
> references.  For example, I want to name sets of objects
> based on scenarios and the types of data being stored.
> So the scenarios might be something like c("a", "b",
> "c"), the types of data might have names like c("pass.trp",
> "trk.trp", "cmute.trp"), and I want to assign data to the
> objects a.pass.trp, b.pass.trp, c.pass.trp, a.trk.trp, etc.
> I'd like to be able to paste the names together and then
> use them as an object references.

For example,

obj <- eval (parse (text=paste ("a", "pass.trp", sep="")))

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list