I am trying to read 1500 csv files ,but I am getting the below error.
Error in read.table(file = file, header = header, sep = sep, quote = quote, : duplicate 'row.names' are not allowed
Code :
fi<-list.files("C:/Users/Desktop/DL/odi_csv_male",full.names=T)
dat<-lapply(fi,read.csv)
But When Individually open and save the file ,I am able to read the files.But as there are 1500 files I need to do it manually .Any help would be much appreciated ?
The file contains version 1.3.0
info team Ireland
info team England
info gender male
info season 2006
info date 6/13/2006
info venue Civil Service Cricket Club, Stormont
info city Belfast
info toss_winner England
info toss_decision bat
info player_of_match ME Trescothick
info umpire R Dill
info umpire DB Hair
info match_referee CH Lloyd
info winner England
info winner_runs 38
ball 1 0.1 England ME Trescothick EC Joyce DT Johnston 0 0
ball 1 0.2 England ME Trescothick EC Joyce DT Johnston 0 0
ball 1 0.3 England ME Trescothick EC Joyce DT Johnston 0 4
lapply(fi, function(f){print(f);read.csv(f)})
will print each file name out as it reads it in. Last file printed in the problem file – Richard Telfordlapply(fi, read.csv, row.names = NULL)
. – Rui Barradas