check.param: Internal-use function for quality checking individual...

View source: R/check.param.R

check.paramR Documentation

Internal-use function for quality checking individual parameters

Description

Internal-use function for quality checking individual parameters

Usage

check.param(
  param = NULL,
  type = c("req", "num", "unit", "uniti", "unitii", "pos", "int", "bool", "vals", "min",
    "mini", "vec", "mat", "sum"),
  valslist = NULL,
  min = NULL
)

Arguments

param

The parameter being checked.

type

The expected type of parameter: one of "req", "num", "unit(i)(i)", "pos", "int", "bool", "vals", "min(i)", "vec", "mat", "sum".

valslist

If the type is "vals", a list of allowed values.

min

If the type is "min" or "mini", a lower bound.

Value

If the check passes, returns nothing. If the check does not pass, throw an error.

Examples

power <- 0.8
check.param(power, "unit")

powertools documentation built on April 4, 2025, 5:02 a.m.