我想将一堆csvs读入R中的列表
lol<-lapply(list.files()[c(grep(Sys.Date(),list.files()))],read.csv)
Run Code Online (Sandbox Code Playgroud)
有些csv文件是空的,所以我得到了
Error in read.table(file = file, header = header, sep = sep, quote = quote, :
no lines available in input
Run Code Online (Sandbox Code Playgroud)
(至少我认为错误意味着)
如何将非空csv文件读入列表?
tryCatch 不起作用(或者我使用它错了)
tryCatch(toplel<-lapply(list.files()[c(grep(Sys.Date(),list.files()))],read.csv),error=function(e){print("lel")})
[1] "lel"
Run Code Online (Sandbox Code Playgroud) r ×1