Try this:

do.call(rbind, mget(ls(pattern = 'data'), envir = .GlobalEnv))

On Wed, Feb 2, 2011 at 5:20 PM, Christopher T. Moore <moor0554@umn.edu>wrote:

> Greetings,
>
> I would like to flexibly combine several data frames objects without
> specifying the exact names of the objects in memory. Should I use indexing
> to call those objects out of memory? I regularly use indexes to flexibly
> extract parts of data frames and lists and to read files from my hard drive,
> but I can't figure out how to do so with stored objects.
>
> In my case, all of the data frames of interest are formatted the same way
> and have been assigned to objects with the prefix "data.". The following
> examples combine only the names (not the objects themselves):
> rbind(ls()[grep("data.", ls(), fixed=T)])
> list(ls()[grep("data.", ls(), fixed=T)])
>
> Is there a way to get ls() (or some other function) to return the object
> instead of just the name? I searched the help files and the R-help archives
> but couldn't find a solution. Thanks in advance.
>
> Sincerely,
> Chris
>
> --
> Christopher T. Moore, M.P.P.
> Doctoral Student
> Quantitative Methods in Education
> University of Minnesota
> 44.9785°N, 93.2396°W
> moor0554@umn.edu
> http://umn.edu/~moor0554 <http://umn.edu/%7Emoor0554>
>
> ______________________________________________
> R-help@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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

	[[alternative HTML version deleted]]

