0

i am appending 100 files in a folder with a delimiter "|". Below is the code used. I am getting an error whichi am not able to debug,

file_list <- list.files()

dataset <- ldply(file_list, read.table, header=TRUE,  sep="|")

ERROR - Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 284 did not have 12 elements

Please help me on this who have experience around this.

  • 1
    You could try with `ldply(file_list, read.table, header=TRUE, fill = TRUE, sep="|")` (the message is quite clear I would say) – talat Feb 25 '15 at 18:38
  • Hey hi, I tried the argument fill = TRUE, it ran for a while and gave me the below error, Error in FUN(X[[29L]], ...) : more columns than column names In addition: Warning messages: 1: In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : EOF within quoted string 2: In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : EOF within quoted string I got the same error 10 times. – Madhuri Maddipatla Feb 26 '15 at 19:11

0 Answers0