[R] for loop with global variables
jholtman at gmail.com
Thu Apr 28 16:31:27 CEST 2011
Yes you can, but there is not enough explaination as to what you
really want to do. I would suggest that you look at using a 'list'
instead of individual objects:
myList <- list(output.1 = rbind('a','b'), output.2 = rbind('c','d'), ...)
Then you can use 'lapply' to operation on the elements.
On Thu, Apr 28, 2011 at 10:16 AM, ivan <i.petzev at gmail.com> wrote:
> is there a possibility to use global variables in a for loop. More
> specifically, I want to do the following:
> next I want to create a data frame with two columns:
> Values output.1 "a","b" output.2 "c","d" output.3 "e","f" .
> output.n …,…
> My problem is that I do not how to define a loop over global variables.
> Anybody an idea?
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Data Munger Guru
What is the problem that you are trying to solve?
More information about the R-help