pairs_regular_make: form pairs of snippets for comparison

Description Usage Arguments Value

View source: R/pairs_make.R

Description

Form pairs of snippets for comparison. By default, form the simple chained minimum-spannning tree of (n - 1), where n is the number snippets, and each snippet is paired with its neighbour. If n.pairs > n, then randomly form addition pairs not already in the MST, where pairs are combinations without respect to order. Note that the maximum number of unique pairings is the combination n choose 2, or n(n - 1)/2.

Usage

1
pairs_regular_make(x, n.sample = NULL, n.pairs = nrow(x) - 1, seed = NULL)

Arguments

x

snippet data.frame

n.sample

subset of observations of x to sample before forming pairwise comparisons

n.pairs

number of pairwise comparisons to form

seed

seed to use for random procedures; set this to ensure replicability

Value

data.frame of paired snippets, consisting of the elements text1, docID1, snippetID1, text2, docID2, and snippetID2.


kbenoit/sophistication documentation built on May 12, 2021, 5:57 a.m.