check_args: Check argument types, length, or dimension

View source: R/check_args.R

check_argsR Documentation

Check argument types, length, or dimension

Description

Check argument types, length, or dimension

Usage

check_args(arg, type, length = NULL, dim = NULL)

Arguments

arg

An argument to be checked.

type

A character vector of candidate argument type.

length

A numeric value of argument length or NULL.

dim

A numeric vector of argument dimension or NULL.

Details

If type, length or dim is NULL, the corresponding check will not be executed.

Value

Check failure detailed error message.

Specification

The contents of this section are shown in PDF user manual only.

Examples

## Not run: 
tbl <- as.data.frame(matrix(1:9, nrow = 3))
simtrial:::check_args(arg = tbl, type = c("data.frame"))

vec <- c("a", "b", "c")
simtrial:::check_args(arg = vec, type = c("character"), length = 3)

## End(Not run)

Merck/simtrial documentation built on April 14, 2025, 5:37 a.m.