On Sat, Dec 27, 2008 at 1:32 PM, Sean Zhang <seane...@gmail.com> wrote:

> My question: How to use a character vector that records object names as
> function input argument?
> ...
> I asked this question very recently and was advised to use get(). get()
> works when passing one single object name. but it does not work when passing
> multiple object names....
>

In general, to apply a function to a list of objects, you can use `lapply`
(similar to map/collect/transform in other programming languages).  Thus,
lapply(all.dfs,get) == list( get(all.dfs[[1]], get(all.dfs[[2]]), ... ).

So for your original problem, you can write:

     do.call(rbind,lapply(all.dfs,get))

Is this what you need?

           -s

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to