[R] get arguments passed to function inside a function

Duncan Murdoch murdoch.duncan at gmail.com
Thu Sep 1 17:27:25 CEST 2011


On 01/09/2011 11:14 AM, Jannis wrote:
> Dear list,
>
>
> I am wondering whether there is an (easy) way to access all arguments and their values passed to a function inside this function and (for example) store them in a list object?
>
> I could imagine using ls() inside this function and then looping through all names and assigning list entries with the values of the respective objects but I could imagine that there is already something ready made in R to achieve this.
>
> Does anybody have an idea?

as.list(environment())  should do it.

Duncan Murdoch



More information about the R-help mailing list