I have the following dataframe:
df =
name1 name2 Value
Dii Rif 8
Dif Dib 5
Fih Qiv 6
I would like to select the row with the following combination:
combination = 'if|ii'
In other words, to select those values of the columns name1 and name2 that have any of the members of the vector combination. Remember that they must both values be in there. In this case ONLY the first row should be selected.
this is what I have tried:
df <- df %>%
select(grep(combination, c('name1', 'name2')))
But I get an empty df.