reconcile: Reconcile a data frame against an external data source

Description Usage Arguments Value Examples

Description

This is the primary function for matching data against a reconciliation endpoint using the Reconciliation Service API standard.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
reconcile(
  data,
  endpoint,
  query_col,
  property_cols = NULL,
  type = NULL,
  match_limit = NULL,
  query_limit = 10,
  matches_only = FALSE
)

Arguments

data

A data frame of candidates for reconciliation, one per row

endpoint

The URL of the reconciliation API endpoint, including API key if required

query_col

The name of the column to use for the main query

property_cols

A vector of column names to use for additional properties (optional)

type

The type of entity to reconcile against (optional)

match_limit

The maximum number of reconciliation matches to return for each candidate (optional)

query_limit

The maximum number of candidates to submit with each query (optional)—defaults to 10. Try a lower number if the API returns a 413 Payload Too Large response

matches_only

Whether to return reconciliation matches on their own, without candidate data (optional)—defaults to "FALSE"

Value

The original data frame with reconciliation matches as additional columns, or a data frame of matches on their own if matches_only is "TRUE".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
gw_companies <- tribble(
  ~name, ~jurisdiction_code, ~country_code,
  "Global Witness", "gb", "gb",
  "Global Witness", "be", "be",
  "Global Witness", "us_ca", "us")

gw_companies %>%
  reconcile(
    endpoint = "https://reconcile.opencorporates.com?api_token=TOKEN",
    query_col = "name",
    property_cols = c("jurisdiction_code", "country_code")) %>%
 filter(match_score >= 75)

Global-Witness/reconciler documentation built on Sept. 8, 2021, 10:13 a.m.