我试过 -
read.zip(file ="C:/Users/dm/Downloads/rprog-data-specdata.zip")
和 -
l = list.files("C:/Users/dm/Downloads/rprog-data-specdata")
read.csv(l[1:332])
但它不能正常工作
答案 0 :(得分:4)
除非你真的希望它们都被提取出来,否则你不必这样做。您可以直接从存档中读取它们:
# you
zipped_csvs <- "rprog-data-specdata.zip"
# get data.frame of file info in the zip
fils <- unzip(zipped_csvs, list=TRUE)
# read them all into a list (or you can read individual ones)
dats <- lapply(fils$Name, function(x) {
read.csv(unzip(zipped_csvs, x), stringsAsFactors=FALSE)
})