[R] combining datasets by row
tkobayas at indiana.edu
tkobayas at indiana.edu
Wed Aug 29 23:41:39 CEST 2007
Rusers,
I am trying to append multiple .csv files of different dimensions (but
# of columns are the same for all .csv files). I do have .csv files
whose names are CA1.csv ~ CA100.csv. CA means california and 1 means
the first file. So what I have been doing (after googling how to append
by row multiple files) was:
cleanup_data<-function(state,count)
{
out<-matrix()
for (i in 1: count)
{
tmp<-read.csv(paste("CTPP3/",state,i,".csv",sep=""),header=F)
out<-rbind(out,tmp)
}
write.csv(file.out,file='file_output.csv')
}
I got an error message:
cleanup_data('CA',7)
Error in match.names(clabs, names(xi)) : names do not match previous names
Which name is this error message referring to?
I decided to get out of Excel and Access trap.....
Thank you very much
Taka
More information about the R-help
mailing list