sub_criteria {diyar} | R Documentation |
Additional matching criteria for each iteration of links
and episodes
.
sub_criteria(
...,
match_funcs = diyar::exact_match,
equal_funcs = diyar::exact_match,
operator = "or"
)
attrs(..., .obj = NULL)
... |
|
match_funcs |
|
equal_funcs |
|
operator |
|
.obj |
|
sub_criteria()
- The mechanism for providing matching criteria to an iteration of links
or episodes
.
It creates a sub_criteria
class object which contains the attributes to be compared,
logical tests for the comparisons (see predefined_tests
for examples) and
another set of logical tests to determine identical records.
attrs()
- Pass a collection of attributes to each ...
in sub_criteria()
.
Every attribute, including those in a collection, must have the same length or a length of 1.
predefined_tests
; links
; episodes
; eval_sub_criteria
# Sub-criteria
s_cri1 <- sub_criteria(c(30, 28, 40, 25, 25, 29, 27),
match_funcs = range_match)
s_cri2 <- sub_criteria(c(30, 28, 40, 25, 25, 29, 27),
match_funcs = exact_match)
# Nested sub-criteria
s_cri3 <- sub_criteria(s_cri1, s_cri2, operator = "or")
s_cri4 <- sub_criteria(s_cri1, s_cri3, operator = "and")
# Objects of the same length
attrs(month.abb, month.name)
# Or a data.frame or list with elements of the same length
attrs(.obj = mtcars)
# Or a combinaiton of the both
attrs(mtcars$mpg, mtcars$cyl, .obj = mtcars)
# Each can then be passed to a `sub-criteria`
sub_criteria(
month.abb,
month.name,
attrs(month.abb, month.name)
)