Get named sets of matches

Share:

Description

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

Usage

1
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://jakebowers.org/, Cole Beck

Examples

1
2
3
4
5
6
7
8
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)