使用 ldply 解压缩会产生错误结果长度不相等

Unzipping with ldply produces Error Results do not have equal lengths

我在使用 ldply 解压缩文件列表时遇到此错误

list_to_dataframe(res, attr(.data, "split_labels"), .id, id_as_factor) 中的错误: 结果的长度不相等

library(curl)
# Create a temporarly file and Temporaly directory
temp_direct <- tempdir()
temp <- tempfile()

#Download ZIP file from web
curl_fetch_disk(url = "https://api.esios.ree.es/archives/9/download?date_type=datos&start_date=01-01-2020&end_date=31-08-2020",
                path = temp)
# Unzip downloaded file in temporaly directory, this creates several ZIP files in it.
unzip(temp, exdir =temp_direct )

# Create a list of files that contain C3 in filename.
zip_c3_pattern <- list.files(path = temp_direct, pattern = '*C3*', full.names = TRUE)
library(plyr)

# unzip all your files with previous pattern
ldply(.data = zip_c3_pattern, .fun = unzip, exdir = temp_direct)

自己解决了将 ldply 替换为 llply

llply(.data = zip_c3_pattern, .fun = unzip, exdir = temp_direct)