subsetMatches {nbpMatching}R Documentation

Subset Matches

Description

Remove unpaired or unnecessary matches.

Usage

subsetMatches(
  matches,
  phantom = TRUE,
  chameleon = TRUE,
  ghost = TRUE,
  infinite = TRUE,
  halvesOnly = TRUE
)

Arguments

matches

A nonbimatch object.

phantom

A logical value. Remove elements matched to phantom elements.

chameleon

A logical value. Remove elements matched to chameleon elements.

ghost

A logical value. Remove elements matched to ghost elements.

infinite

A logical value. Remove elements matched at infinite distance. This will include elements forced to match in spite of having an infinite distance set by the prevent option in gendistance.

halvesOnly

A logical value. Use halves element instead of matches.

Details

Given a nonbimatch object, remove elements matched to phantoms, chameleons, or ghosts. Also remove pairs whose distance is infinite.

Value

a data.frame

Author(s)

Cole Beck

Examples


df <- data.frame(id=LETTERS[1:25], val1=rnorm(25), val2=rnorm(25))
df.dist <- gendistance(df, idcol=1, ndiscard=4)
df.mdm <- distancematrix(df.dist)
df.match <- nonbimatch(df.mdm)
subsetMatches(df.match)
subsetMatches(df.match, halvesOnly=FALSE)
subsetMatches(df.match, phantom=FALSE)


[Package nbpMatching version 1.5.5 Index]