I want to know how to store the values of the complete loop output into a single dataframe in R. For example,
for(i in unique(x$id)){
.
.
.
y=output of one iteration}
At the end of each iteration, I am getting the output in y. But I want to store output of all iterations into y. How do I do that in R?
lapply
. It's designed for this.