a - 1:3
b - 11:13
c - 21:23
names - c('a','b','c')
do.call(data.frame, list(sapply(names, function(x) get(x
runner wrote:
What I am trying to do is as follows:
- I have listed names of all wanted objects (datasets A,B,C... ) in
current workspace as a vector:
obj -
What I am trying to do is as follows:
- I have listed names of all wanted objects (datasets A,B,C... ) in current
workspace as a vector:
obj - c('A','B','C')
- then i need to use these objects, say to extract all the 1st columns and
bind to an existing dataset ('data'):
for ( i in 1:3){
This should work:
do.call(cbind, lapply(1:length(obj), function(i) get(obj[i])[,1]))
Best,
Giovanni
Date: Fri, 07 Sep 2007 14:42:07 -0700 (PDT)
From: runner [EMAIL PROTECTED]
Sender: [EMAIL PROTECTED]
Precedence: list
What I am trying to do is as follows:
- I have listed names of
get might be good enough for you:
a - 10
name - a
get(a)
[1] 10
get(name)
[1] 10
Gabor
On Fri, Sep 07, 2007 at 02:42:07PM -0700, runner wrote:
What I am trying to do is as follows:
- I have listed names of all wanted objects (datasets A,B,C... ) in current
workspace as a vector: