Kenn Konstabel writes:
> Another way (not elegant but better and shorter than the eval-parse
> way) is to use get. ?get
This one is handy for interactive use, thanks for the hint.
Kind Regards,
Michael Bach
__
R-help@r-project.org mailing list
https:
"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.
Hi Michael.
This is a classic :-)
ObjectsOfInterest<- list(one_df, two_df, three_df)
for(namedf in ObjectsOfInterest){...}
or probably even better
sapply(ObjectsOfInterest, function(namedf){...})
hth.
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure L
On Fri, Apr 29, 2011 at 1:03 PM, Michael Bach wrote:
> Dear R Users,
>
> I am trying to get the following to work better:
>
> namevec <- c("one", "two", "three")
> for (name in namevec) {
> namedf <- eval(parse(text=paste(name, "_df", sep="")))
> ...
> ...
> }
>
> The rationale behind it
4 matches
Mail list logo