I have multiple csv files. I want to place the content of all the column ones from all the csv files in one column. I also want do not want specific number of rows to be included in this.
Example file1.csv
Column1 Column2
A 1
B 2
C 3
D 4
E 5
file2.csv
Column1 Column2
F 6
G 7
H 8
I 9
J 10
Result Result.csv
Column1 Column2
C 3
D 4
E 5
H 8
I 9
J 10
My code:
temp = list.files(pattern="*.csv")
myfiles = lapply(temp, read.delim,nrow=4292,skip=1472,sep=",")
nana<-do.call(rbind,myfiles)
write.table(nana,"result_polmeans.csv",sep=",")
This code produces 2 columns per each csv file. The error stems from do.call function Error in match.names(clabs, names(xi)) : names do not match previous names
do.call(rbind,myfiles)