amerge: Merge two datasets based on both exact and approximate keys

Description Usage Arguments See Also Examples

View source: R/strings.R

Description

amerge merges two datasets by exact keys and filter out rows that do not approximately match by given string keys.

Usage

1
amerge(x, y, aby, method = "jw", tol = 0.1, p = 0.1, ...)

Arguments

x

A data.frame or data.table.

y

A data.frame or data.table.

aby

name of a string key for approximate matching

method

Method for distance calculation.

tol

tolerance of dissimilarity between string keys in matched datasets

p

see stringdist package

...

other parameters passed to merge

See Also

merge, stringdist and stringsim

Examples

1
2
3
4
5
6
7
8
9
dt1 <- data.table(id   = c(1,      2,             3,      4,                  5),
                  name = c("Aple", "Google inc.", "ABB",  "Sun",              "Sony"),
                  value = rnorm(5))

dt2 <- data.table(id   = c(1,       2,             3,     4,                  5),
                  name = c("Apple", "Google",     "BBC",  "Sun Microsystems", "Sony Corporation"),
                  value = rnorm(5))

amerge(dt1, dt2, by = "id", aby = "name", tol = 0.3)

vh-d/VHtools documentation built on May 3, 2019, 6:11 p.m.