Hi, I am a beginner in R and have only read a few chapters in the R book, I was not able to find a solution for this simple problem.
I have an empty data frame: a=data.frame(name="test") which I would like to extend in a for-loop (with data extracted from a database). Ideally I would like to extend the data frame like this: a["new_1"] = 1:10 a["new_1"] = 1:12 a["new_1"] = 1:14 R now obviously complains about the changing length of the new columns. However, I would like to have missing values being added whenever columns are shorter than a newer (longer) column. How can I do that? Thanks, Ralf ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.