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

______________________________________________
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