【问题标题】:R - Using rbind with list of data frames and a subset of columnsR - 将 rbind 与数据框列表和列子集一起使用
【发布时间】:2016-05-12 15:15:59
【问题描述】:

如何仅使用特定列来绑定数据框列表? do.call(rbind, data) 之类的东西可以正常工作,但我不知道如何排除特定列的向量。之后删除不必要的列似乎是可以的,但也许有更简洁的方法可以做到这一点?

【问题讨论】:

标签: r merge dataframe rbind


【解决方案1】:

我可以简单地使用subset(感谢@Jaap):

do.call(rbind, lapply(data, subset, select=c("use_this", "and_this")))

【讨论】:

    猜你喜欢
    • 2019-10-17
    • 2019-04-16
    • 2018-11-22
    • 1970-01-01
    • 2018-10-09
    • 2017-10-23
    • 2021-12-16
    • 1970-01-01
    • 2012-11-18
    相关资源
    最近更新 更多