【发布时间】:2021-02-13 13:55:16
【问题描述】:
在下面的示例中是否可以在包含id 或group 或两者的向量中找到名称?
我使用grepl()没有成功。
a = c("c-id" = 2, "g_idgroups" = 3, "z+i" = 4)
grepl(c("id", "group"), names(a)) # return name of elements that contain either `id` OR `group` OR both
【问题讨论】:
标签: r regex string character tidyverse