regex_join: Join two tables based on a regular expression in one column...

Description Usage Arguments See Also Examples

View source: R/regex_join.R

Description

Join a table with a string column by a regular expression column in another table

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
regex_join(x, y, by = NULL, mode = "inner", ignore_case = FALSE)

regex_inner_join(x, y, by = NULL, ignore_case = FALSE)

regex_left_join(x, y, by = NULL, ignore_case = FALSE)

regex_right_join(x, y, by = NULL, ignore_case = FALSE)

regex_full_join(x, y, by = NULL, ignore_case = FALSE)

regex_semi_join(x, y, by = NULL, ignore_case = FALSE)

regex_anti_join(x, y, by = NULL, ignore_case = FALSE)

Arguments

x

A tbl

y

A tbl

by

Columns by which to join the two tables

mode

One of "inner", "left", "right", "full" "semi", or "anti"

ignore_case

Whether to be case insensitive (default no)

See Also

str_detect

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(dplyr)
library(ggplot2)
data(diamonds)

diamonds <- tbl_df(diamonds)

d <- data_frame(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"))

fuzzyjoin documentation built on June 20, 2017, 9:06 a.m.

Search within the fuzzyjoin package
Search all R packages, documentation and source code