dict_join: Join two tables based on a character column of a dictionary...

View source: R/join.r

dict_joinR Documentation

Join two tables based on a character column of a dictionary or Lucene-like Boolean queries

Description

Essentially dplyr's join operations (see join) but with additional query features.

Usage

dict_join(x, y, by, mode = "left", ...)

dict_left_join(x, y, by, ...)

dict_right_join(x, y, by, ...)

dict_full_join(x, y, by, ...)

dict_inner_join(x, y, by, ...)

Arguments

x, y

A pair of data frames, data frame extensions (e.g. a tibble)

by

A character vector of variables to join by. To join on different variables between 'x' and 'y', use a named vector. For example, 'by = c("a" = "b")' will match 'x$a' to 'y$b'.

mode

One of "left", "right" or "full".

...

Handed to search_query.

Value

A data.table or tibble

Examples

df = data.frame(
  text = c('This is just a simple example', 'Simple is good'),
  doc_id = c(1, 2)
)
dict_join(df, dict, by = c("text" = "string"))
dict_left_join(df, dict, by = c("text" = "string"))
dict_right_join(df, dict, by = c("text" = "string"))
dict_full_join(df, dict, by = c("text" = "string"))

kasperwelbers/textquery documentation built on Dec. 24, 2024, 12:47 a.m.