check_target: Check if argument is a valid target object

Description Usage Arguments Details Value

View source: R/checkmate.R

Description

A target object is either a named list that contains integer values (static target) or a data.frame that contains a 'time' column and other response columns (dynamic target). The type of of the target depends on its usage.

Usage

1
2
3
4
5
6
7
check_target(x, null.ok = TRUE)

assert_target(x, null.ok = TRUE, .var.name = checkmate::vname(x), add = NULL)

test_target(x, null.ok = TRUE)

expect_target(x, null.ok = TRUE, info = NULL, label = vname(x))

Arguments

x

any object to check

null.ok

default as TRUE

.var.name

[character(1)]
The custom name for x as passed to any assert* function. Defaults to a heuristic name lookup.

add

checkmate::AssertCollection
Collection to store assertions. See checkmate::AssertCollection.

info

[character(1)]
See expect_that

label

[character(1)]
See expect_that

Details

Here is an example of a static target list(yes=10, no=20). Here is an example of a dynamic target data.frame(time = c(1,2,3), yes = c(10,11,12), no = c(20,21,22).

Value

TRUE if x is a valid target object else throws an error.


dymium-org/dymiumCore documentation built on July 18, 2021, 5:10 p.m.