I've read in a table df
which has numbers and strings.
I have a keywords stored in a vector arr_words
. For every row in the table; if row contains any word from the vector ignoring case, I want to keep that row.
For instance, if one of the cells has "i like magIcalot", and one of my keywords is "magic", I want to keep all the attributes from that row.
I've been trying this, but I'm pretty sure it's wrong since it's getting me back zero rows-
df %>%
rowwise() %>%
filter(any(names(df) %in% arr_words))