【发布时间】:2015-01-22 11:58:02
【问题描述】:
例如:三个 R 工作区 A.RData、B.RData 和 C.RData。
- 在
A.RData:一个列表对象list.example <- list(1,2) - 在
B.RData:同名列表对象list.example <- list(NULL,NULL,3) - 在
C.RData: 同名列表对象list.example <- list(NULL,NULL,NULL,4)
我想在新工作区中得到一个对象list.new.example,打印为:
[[1]]
[1] 1
[[2]]
[1] 2
[[3]]
[1] 3
[[4]]
[1] 4
我试过了
file.full <- list.files(directory, full.names = TRUE)
list.new.example <- list()
for (i in 1:3) {
load(file.full[i])
list.new.example <- c(list.new.example, list.example)
}
print(list.new.example)
但这不是我想要的。 NULL 正在填满。所以谢谢。
【问题讨论】: