问题
I'm using the following code to read a set of CSV files:
csvfiles = list.files(pattern = "*.csv", path = "./Data/",
full.names = TRUE)
## Merge into one object
myfiles = lapply(csvfiles, read.delim)
I would like to pass some arguments to the read.delim function in order to skip a set of initial rows, define delimiter and so on but whenever I try doing this R returns an error, as illustrated below:
> myfiles = lapply(csvfiles, read.delim(skip = 2))
Error in read.table(file = file, header = header, sep = sep, quote = quote, :
argument "file" is missing, with no default
What would the correct syntax to modify the parameters of the read.delim function when used in conjunction with the lapply, as illustrated above?
来源:https://stackoverflow.com/questions/25958505/arguments-in-read-delim-when-used-in-lapply