powered by
Check Argument Types, Length or Dimension
check_args(arg, type, length = NULL, dim = NULL)
Check failure detailed error message
An argument to be checked.
A character vector of candidate argument type.
A numeric value of argument length or NULL
A numeric vector of argument dimension or NULL.
The contents of this section are shown in PDF user manual only.
if type, length or dim is NULL, the corresponding check will not be executed.
type
length
dim
if (FALSE) { 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 = c(2, 4)) }
Run the code above in your browser using DataLab