cluster_pair_blocking function

Generate pairs using simple blocking using multiple processes

Generate pairs using simple blocking using multiple processes

Generates all combinations of records from x and y where the blocking variables are equal.

cluster_pair_blocking( cluster, x, y, on, deduplication = FALSE, name = "default" )

Arguments

  • cluster: a cluster object as created by makeCluster

    from parallel or from the snow package.

  • x: first data.frame

  • y: second data.frame. Ignored when deduplication = TRUE.

  • on: the variables defining the blocks or strata for which all pairs of x and y will be generated.

  • deduplication: generate pairs from only x. Ignore y. This is usefull for deduplication of x.

  • name: the name of the resulting object to create locally on the different R processes.

Returns

A object of type cluster_pairs which is a list containing the cluster and the name of the pairs object on the cluster nodes. For the pairs objects created on the nodes see the documentation of pair.

Details

Generating (all) pairs of the records of two data sets, is usually the first step when linking the two data sets. However, this often results in a too large number of records. Therefore, blocking is usually applied.

x is split into length{cluster} parts which are distributed over the worker nodes. y is copied to each of the nodes. On the nodes then pair_blocking is called. The pairs are stored in the global object reclin_env on the nodes in the variable name. The pairs can then be further processes using functions such as compare_pairs, and tabulate_patterns. The function cluster_collect collects the pairs from each of the nodes.

Examples

library(parallel) data("linkexample1", "linkexample2") cl <- makeCluster(2) pairs <- cluster_pair_blocking(cl, linkexample1, linkexample2, "postcode") stopCluster(cl)

See Also

cluster_pair and cluster_pair_minsim are other methods to generate pairs.

  • Maintainer: Jan van der Laan
  • License: GPL-3
  • Last published: 2024-02-09