【问题标题】:Is there a way to use str_detect with group_by in R?有没有办法在 R 中将 str_detect 与 group_by 一起使用?
【发布时间】:2020-11-03 12:04:07
【问题描述】:

我想创建一组变量名称中都包含“AA”的变量,这样我就可以为新组创建汇总统计信息。我不确定如何结合 str_detect 和 group_by 函数。

【问题讨论】:

标签: r string variables group-by


【解决方案1】:

这样的事情应该可以工作:

data %>% 
  group_by(across(contains("AA")))

如果您需要更多指导,请提供可重现的示例或示例数据。

【讨论】:

    猜你喜欢
    • 2021-08-28
    • 2018-03-15
    • 2016-11-01
    • 1970-01-01
    • 2018-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多