library(dplyr)
if (requireNamespace("ggplot2", quietly = TRUE)) {
diamonds <- tibble::as_tibble(ggplot2::diamonds)
d <- tibble::tibble(regex_name = c("^Idea", "mium", "Good"),
type = 1:3)
# When they are inner_joined, only Good<->Good matches
diamonds %>%
inner_join(d, by = c(cut = "regex_name"))
# but we can regex match them
diamonds %>%
regex_inner_join(d, by = c(cut = "regex_name"))
}
Run the code above in your browser using DataLab