get.sets: Get named sets of matches

get.setsR Documentation

Get named sets of matches

Description

Create a factor variable using the names from a matched data set.

Usage

get.sets(matches, remove.unpaired = TRUE, ...)

Arguments

matches

A data.frame or nonbimatch object. Contains information on how to match the covariate data set.

remove.unpaired

A boolean value. The default is to remove elements matched to phantom elements.

...

Additional arguments, not used at this time.

Details

Calculate a name for each pair by using the ID columns from the matched data set. Return a factor of these named pairs.

Value

a factor vector

Author(s)

Jake Bowers, http://www.jakebowers.org/, Cole Beck

Examples


df <- data.frame(id=LETTERS[1:25], val1=rnorm(25), val2=rnorm(25))
df.dist <- gendistance(df, idcol=1)
df.mdm <- distancematrix(df.dist)
df.match <- nonbimatch(df.mdm)
get.sets(df.match)
get.sets(df.match$matches)
# include the phantom match
get.sets(df.match$matches, FALSE)


nbpMatching documentation built on Sept. 25, 2024, 9:06 a.m.