I have 198 txt files in a single directory. The filenames are stored in a list called filelist. Each file has 7 columns and a different number of rows (100-200). One file appears to have 8 columns. I used the following code
dat<-data.frame()
for (i in 1:n)
{
dat<-rbind.fill(dat,read.table(filelist[i],sep=",",header=TRUE))
}
I get the error
"Error in read.table(filelist[i], sep = ",", header = TRUE) : duplicate 'row.names' are not allowed".
Some posts suggest I should add rownames=NULL but I tried this and get the error message
"Error in read.table(filelist[i], sep = ",", header = TRUE, rownames = NULL) : unused argument (rownames = NULL)"
All guidance would be much appreciated.
read.csvinstead since you seem to be settingsep=","- MrFlick