I have experimented with different solutions (including several discussed on stackoverflow and the R help thread) for a couple of days. None has produced a good solution. Hence this posting.
I need to create a data frame
df <- as.data.frame (matrix (nrow = 3470, ncol = 22,000)
The first 3 columns are character / string data. rest are numerical data. The mixed mode screwed up this approach.
df <- data.frame (c1 = char(22,000), c2 = char(22,000), c3 = char(22,000), .....)
Is there any way to set columns 4 to 22,000 as numeric in this solution? (then I can use colnames (df) to set the real names).
While initializing data frames with something like
df <- data.frame (c1 = char(22,000), c2 = char(22,000), c3 = char(22,000), .....)
is there a mechanism for using something like rep to declare that c4 to c22,000 are numeric?
Thank you very much. (I know initializing data frame has been discussed several times. I tried several approaches, yet to find a good solution). Hence this post to a topic that has been beaten to death.