Hi I am new here and a beginner in R,
My problem: in the case i have more than one file (test1.dat, test2.dat,...) to work with in R i use this code to read them in
filelist <- list.files(pattern = "*.dat")
df_list <- lapply(filelist, function(x) read.table(x, header = FALSE, sep = ","
,colClasses = "factor", comment.char = "",
col.names = "raw"))
Now i have the problem that my data is big, i found a solution to speed things up using the sqldf-package :
sql <- file("test2.dat")
df <- sqldf("select * from sql", dbname = tempfile(),
file.format = list(header = FALSE, row.names = FALSE, colClasses = "factor",
comment.char = "", col.names ="raw"))
it is working well for one file but i am not able to change the code to read-in multiple files like in the first code snippet. can someone help me? Thank you! Momo