Learn R Programming

diyar (version 0.2.0)

sub_criteria: Sub-criteria for links

Description

Additional matching conditions for each stage in links.

Usage

sub_criteria(..., funcs = diyar::exact_match)

Arguments

...

Additional attributes to compare.

funcs

User defined logical test.

Value

function or list of functions

Details

sub_criteria() is the mechanism for providing a sub_criteria to an instance of links.

Each attribute (atomic vectors) is compared as an exact match or with a user-defined logical test. The test must be supplied as a function with at least two arguments named `x` and `y`. Where `y` is the value for one observation being compared against all other observations (`x`).

Each attribute must have the same length.

funcs must be a function or list of functions to use with each attribute.

Each funcs must evaluate to TRUE or FALSE.

Each sub_criteria must be linked to a criteria in links. You can link multiple sub_criteria to one criteria. Any unlinked sub_criteria will be ignored.

Examples

Run this code
# NOT RUN {
library(diyar)

sub_criteria(c(30, 28, 40, 25, 25, 29, 27), funcs = range_match)

# Link each `sub_critera` a `criteria`.
list(
c1 = sub_criteria(c(30, 28, 40, 25, 25, 29, 27), funcs = range_match),
c2 = sub_criteria(c(30, 28, 40, 25, 25, 29, 27), funcs = range_match))
# }

Run the code above in your browser using DataLab