Entering edit mode
12.1 years ago
Bmusungu
▴
20
> files <- list.files(pattern=".csv")
> files
[1] "GDS2475.csv" "GDS2477.csv" "GSE12594_soft.csv"
[4] "GSE15435.csv" "GSE20130.csv"
> data()
> DF <- NULL
> for (f in files) {
+ dat <- read.csv(f, header=T, sep="\t", na.strings="",
+ colClasses="character")
+ DF <- rbind(DF, dat)
+ }
Error in match.names(clabs, names(xi)) :
names do not match previous names
>
I saw this script for reading multiple csv files and combining. I got the error in the bottom. Any suggestions would be helpful, because I am new to R.