cluster_collect {reclin2}R Documentation

Collect pairs from cluster nodes

Description

Collect pairs from cluster nodes

Usage

cluster_collect(pairs, select = NULL, clear = FALSE)

Arguments

pairs

an object or type cluster_pairs as created for example by cluster_pair.

select

the name of a logical column that is used to select the pairs that will be collected

clear

remove the pairs from the cluster nodes

Value

Returns an object of type pairs which is a data.table. This object can be used as a regular (non-cluster) set of pairs

Examples

library(parallel)
data("linkexample1", "linkexample2")
cl <- makeCluster(2)


pairs <- cluster_pair(cl, linkexample1, linkexample2)
local_pairs <- cluster_collect(pairs, clear = FALSE)

compare_pairs(pairs, c("lastname", "firstname", "address", "sex"))
model <- problink_em(~ lastname + firstname + address + sex, data = pairs)
predict(model, pairs, type = "mpost", add = TRUE, binary = TRUE)
# Select pairs with a mpost > 0.5
select_threshold(pairs, "selected", "mpost", 0.5)
# Collect the selected pairs
local_pairs <- cluster_collect(pairs, "selected")

stopCluster(cl)

[Package reclin2 version 0.5.0 Index]