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

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)
#> var_1 
#>  TRUE 
is_used("var_2", ll)
#> var_2 
#> FALSE 
is_used("b_1", ll)
#>  b_1 
#> TRUE 
is_used(c("b_1", "var_1"), ll)
#>   b_1 var_1 
#>  TRUE  TRUE