You could use a combination of
paste() (to create a text string to evaluate)
eval(parse(text="the command")) (to evaluate the string)
e.g. if your vector is c("a", "b") you want:
eval(parse(text="data.frame(a,b)"))
Tim Hesterberg
>Hi S-News readers,
>
>I'm looking for a way to create a data frame using a vector of character
>strings returned by the objects() function. In other words, objects(pat=
>"xdata.*") returns a charcter vector of the names of objects, but I
>haven't figured out how to convert this character vector into the actual
>objects to pass to the data.frame() function. I know it seems straight
>forward but I haven't figured out how to do it.
>
>I'd appreciate help and suggestions.
>
>Thanks in advance.
>
>Paul Schwarz
========================================================
| Tim Hesterberg Research Scientist |
| timh@insightful.com Insightful Corp. |
| (206)802-2319 1700 Westlake Ave. N, Suite 500 |
| (206)283-8691 (fax) Seattle, WA 98109-3012, U.S.A. |
| www.insightful.com/Hesterberg |
========================================================
Download the S+Resample library from www.insightful.com/downloads/libraries
Two Research Scientist positions:
data mining
frailty/mixed effects
http://www.insightful.com/company/jobs.asp
Speak out about biased science in Washington D.C.
http://home.comcast.net/~timhesterberg/ScientificIntegrity.html
|