Learn R Programming

scoringutils (version 2.3.0)

assert_strategy: Assert that a strategy has the expected signature

Description

Internal helper used by filter_scores() and impute_missing_scores() to check that a user-supplied strategy function has at least the required named formals. This catches common mistakes early (e.g. forgetting the compare argument) without constraining the strategy author to a specific internal type.

Usage

assert_strategy(strategy, required)

Value

invisible(NULL). Called for its side effect of erroring when the check fails.

Arguments

strategy

A function.

required

Character vector of formal names that strategy must accept.