check_args: Check Argument Types, Length or Dimension

Description Usage Arguments Details Value Specification Examples

View source: R/check_args.R

Description

Check Argument Types, Length or Dimension

Usage

1

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

1
2
3
4
5
6
7
8
## Not run: 
tbl < -as.data.frame(matrix(1:9, nrow = 3))
check_args(arg = tbl, type = c("data.frame"))

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

## End(Not run)

r2rtf documentation built on Sept. 10, 2021, 1:06 a.m.