match_evaluate: match_evaluate

Description Usage Arguments Value See Also Examples

View source: R/match_evaluate.R

Description

evaluate a matched dataset

Usage

1
2
3
match_evaluate(matches, data1, data2, unique_key_1, unique_key_2,
  suffixes = c(".x", ".y"), tier = NULL, tier_order = NULL,
  aggregate_by = "unique", quality_vars = NULL, dupe_ratio = FALSE)

Arguments

matches

data.frame. Merged dataset.

data1

data.frame. First to-merge dataset.

data2

data.frame. Second to-merge dataset.

unique_key_1

character vector. Primary key of data1 that uniquely identifies each row (can be multiple fields)

unique_key_2

character vector. Primary key of data2 that uniquely identifies each row (can be multiple fields)

suffixes

character vector. Mnemonics associated data1 and data2.

tier

character vector. Default=NULL. The variable that defines a tier.

tier_order

character vector. Default=NULL. Variable that defines the order of tiers, if needed.

aggregate_by

character vector. Default='unique'. Variable aggregated to calculate statistics. If equal to 'unique', aggregation is count, if otherwise, sum.

quality_vars

character vector. Variables you want to use to calculate the quality of each tier. Calculates mean.

Value

data.frame. Table describing each tier according to aggregate_by variables and quality_vars variables.

See Also

merge_plus

Examples

1
2
3
4
x = data.frame('id'=1:5,'name'=c('a','b','c','d','d'), 'amount' = 101:105)
y = data.frame('id'=6:10,'name'=c('b','c','d','e','f'), 'amount' = rep(102,5))
matches = merge_plus(x,y,by='name',unique_key_1='id','unique_key_2'='id', matchscore_settings = list('amount'=list('compare_type'='difference',weight=1)), evaluate=NULL)$'matches'
match_evaluate(matches, x, y, 'id.x', 'id.y')  

mfriedri12/fedmatch documentation built on Aug. 4, 2017, 7:41 a.m.