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=out
You can do this simply by
y <- NULL; for (i in unique(x$id)) { tmp <- [output of one iteration] y <- rbind(y, tmp) }