R - 将 rbind 与数据框列表和列子集一起使用
R - Using rbind with list of data frames and a subset of columns
如何仅使用特定列来绑定数据框列表? do.call(rbind, data)
之类的东西工作正常,但我不知道如何排除特定列的向量。之后删除不必要的列似乎没问题,但也许有更简洁的方法来做到这一点?
我可以简单地使用 subset
(感谢@Jaap):
do.call(rbind, lapply(data, subset, select=c("use_this", "and_this")))
如何仅使用特定列来绑定数据框列表? do.call(rbind, data)
之类的东西工作正常,但我不知道如何排除特定列的向量。之后删除不必要的列似乎没问题,但也许有更简洁的方法来做到这一点?
我可以简单地使用 subset
(感谢@Jaap):
do.call(rbind, lapply(data, subset, select=c("use_this", "and_this")))