optmatch_same_distance: Checks if the distance 'newdist' is identical to the distance...

View source: R/Optmatch.R

optmatch_same_distanceR Documentation

Checks if the distance newdist is identical to the distance used to generate the optmatch object obj.

Description

To save space, optmatch objects merely store a hash of the distance matrix instead of the original object. This checks if the hash of newdist is identical to the hash currently saved in obj.

Usage

optmatch_same_distance(obj, newdist)

Arguments

obj

An optmatch object.

newdist

A distance

Details

Note that the distance is hashed with its call set to NULL. (This avoids issues where, for example, match_on(Z~X, data=d, caliper=NULL) and match_on(Z~X, data=d) produce identical matches (since the default argument to caliper is NULL) but distinct calls.)

Value

Boolean whether the two distance specifications are identical.


jgellar/GroupMatch documentation built on Nov. 8, 2022, 10:48 p.m.