Re: [R] Reference variables by string in for loop

From: Michael Bach <>
Date: Fri, 29 Apr 2011 15:04:00 +0300

"Nick Sabbe" <> writes:

> ObjectsOfInterest<- list(one_df, two_df, three_df)
> for(namedf in ObjectsOfInterest){...}

I see. This is also more readable and traceable for others.

> or probably even better
> sapply(ObjectsOfInterest, function(namedf){...})

I like this one for its functional style.

> hth.

It did, thanks.

Kind Regards,
Michael Bach mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Fri 29 Apr 2011 - 12:11:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 29 Apr 2011 - 12:50:35 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive