【发布时间】:2021-01-24 02:57:24
【问题描述】:
在尝试此代码时,我遇到了错误。 'a' 是一个数据框列表,由从 b 中的文件中提取的数据组成。 'a' 中有一些空的数据框/记录:
b <- list.files(path=".", pattern=".xlsx")
c <- Map(cbind, b, a)
我收到了这个错误:
Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 1, 0
无论如何我可以纠正这个问题?
【问题讨论】:
-
你能检查一下
sapply(a, dim)和sapply(b, dim) -
如果一个列表元素为空,是否要保留该列表元素