I have about 200 data frames that are each 100000 rows by 45 columns. The columns are all the same. I would like to stack these into one data frame.
(I got the 160 data frames by splitting a LARGE text file into 200 smaller ones and using read.csv())
Some of the columns contain strings and some contain numbers. I have read this answer and know I shouldn't use rbind() to accomplish this, but I am running into trouble. The V1 columns in my data set contain strings. But when I run my code to insert just the first 100000:
#load in miniset1
load("filepath.Rda")
filetest <- data.frame(matrix(nrow=2000000, ncol = 45))
colnames(filetest)<-gsub("X", "V", colnames(filetest))
filetest[1:100000,]<-miniset1
head(filetest)
....it looks like it is trying to make V1 a number instead of a string. For example, it print the number "5777" in the head() call instead of the name that is written there. Is there a way I can specify that when I am making the initial matrix? I would rather just be able to use the characteristics from one of the datasets than have to go in an manually code whether each of the columns is string or numeric.