I want to rbind a loop that generates data.frames. Here's a [incorrect] loop of the general idea I'm looking for.
for (i in 1:2){
a <- c(2, (i+10))
b <- c((i+10)), 5))
c[i] <- data.frame(a,b)
}
rbind(c)
I want an output like this:
2 11
11 5
2 12
12 5
This question has been asked before, but the answer was a direct solution, with no explanation. I don't know how to read it. It involved do.call
and mget
.