is_used: Checks if the supplied character string is used in the...

View source: R/assertions.R

is_usedR Documentation

Checks if the supplied character string is used in the function

Description

This assertion is useful for debugging and to check if necessary varibles and parameters are included and used.

Usage

is_used(x, func)

Arguments

x

A character string or vector with one or more variables or parameters

func

A function

Examples

ll <- function(param) {
  V <- list(
    alt1 = asc_1 + b_1 * var_1
  )
}

is_used("var_1", ll)
is_used("var_2", ll)
is_used("b_1", ll)
is_used(c("b_1", "var_1"), ll)


edsandorf/cmdlR documentation built on Jan. 17, 2024, 12:33 a.m.