I would like to have something like this:
#initialize a empty data frame without saying what the column names are
dataFrame = data.frame()
for(1:20){
Create a row
dataFrame = rbind(dataFrame, row)
}
The rows created in the for loop will have all the same column names. So is it possible to not initialize the column names?
Update:
Thank you all for the help.
But I wasn't clear with my answer, sorry.
I would like to have the names of the columns, stated in the for loop.
I now get the following message:
Error in match.names(clabs, nmi) : names do not match previous names
And what I can see is that the spaces in the column names get changed to dots.
Is there a way so the names don't change or change beforehand.
for ()loop. Don't assume that R does things the same way as other programming languages. Tell us what you are trying to accomplish, don't tell use how you want to accomplish it.