[R] value of variable in ls()

James Toll james at jtoll.com
Mon Oct 19 16:16:34 CEST 2015


> On Oct 18, 2015, at 10:51 AM, Christian Hoffmann <christian at echoffmann.ch> wrote:
> 
> How can I do e.g. print("unknown"(ls())) and get the variable values in my current environment?

From your example, it sounds like what you want is simply this:

sapply(ls(), get)


James



More information about the R-help mailing list