Is is possible to find the names in a vector that contain either id
OR group
Or both in the example below?
I have used grepl()
without success.
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