I have a data frame (a tibble, actually) df
, with two columns, a
and b
, and I want to filter out the rows in which a
is a substring of b
. I've tried
df %>%
dplyr::filter(grepl(a,b))
but I get a warning that seems to indicate that R is actually applying grepl
with the first argument being the whole column a
.
Is there any way to apply a regular expression involving two different columns to each row in a tibble (or data frame)?