【发布时间】:2018-03-10 12:31:02
【问题描述】:
我在 R 中有以下数据框:
我想使用 dplyr 根据不同列的行总和过滤行:
unqA unqB unqC totA totB totC
3 5 8 16 12 9
5 3 2 8 5 4
我想要 sum(all Unq)
我试过类似的东西:
filter(df, rowsum(matches("unq")) <= 0.10*rowsum(matches("totalC")))
Or:
filter(df, rowsum(unqA, unqB..) <= 0.10*rowsum(totA, totB..))
我只想选择唯一计数总和
但是,它不起作用或只是返回没有行的数据。
任何建议。
【问题讨论】: