[R] how to use do.call("rbind", get(list(mlist)))

roger bos roger.bos at gmail.com
Fri Jan 21 18:07:19 CET 2005


I have around 200 data frames I want to rbind in a vectorized way. 
The object names are:

m302
m303
...
m500

So I tried:

mlist <- paste("m",302:500,sep="")
dat <- do.call("rbind", get(list(mlist)))

and I get "Error in get(x, envir, mode, inherits) : invalid first argument"

I know "rbind" is valid because 

dat <- rbind(m302, m303, m304, m305)

works, I am just too lazy to type it out to m500.

I also tried it without the get() portion, but then dat ends up being
a column with just the names of the objects, not the objects
themselves.

Thanks in advance for showing me the errors in my attempts.

Roger




More information about the R-help mailing list