Check the validity of the arguments in functions.
validCharacter(
value1,
name1 = as.character(substitute(value1)),
valid.length,
valid.values = "character",
refuse.NULL = TRUE,
refuse.duplicates = FALSE,
method = NULL,
addPP = TRUE
)validClass(
value1,
name1 = as.character(substitute(value1)),
valid.class,
type = "inherits",
method = NULL,
addPP = TRUE
)
validDimension(
value1,
value2 = NULL,
name1 = as.character(substitute(value1)),
name2 = as.character(substitute(value2)),
valid.dimension = NULL,
type = c("NROW", "NCOL"),
method = NULL,
addPP = TRUE
)
validInteger(
value1,
name1 = as.character(substitute(value1)),
valid.length,
min = NULL,
max = NULL,
refuse.NA = TRUE,
refuse.NULL = TRUE,
refuse.duplicates = FALSE,
method = NULL,
addPP = TRUE
)
validLogical(
value1,
name1 = as.character(substitute(value1)),
valid.length,
refuse.NULL = TRUE,
refuse.NA = TRUE,
method = NULL,
addPP = TRUE
)
validNames(
value1,
name1 = as.character(substitute(value1)),
refuse.NULL = TRUE,
valid.length = NULL,
valid.values = NULL,
required.values = NULL,
refuse.values = NULL,
method = NULL,
addPP = TRUE
)
validNumeric(
value1,
name1 = as.character(substitute(value1)),
valid.length,
valid.values = NULL,
min = NULL,
max = NULL,
refuse.NA = TRUE,
refuse.NULL = TRUE,
refuse.duplicates = FALSE,
method = NULL,
addPP = TRUE,
unlist = FALSE
)
validPath(
value1,
name1 = as.character(substitute(value1)),
type,
method = NULL,
addPP = TRUE,
extension = NULL,
check.fsep = FALSE
)
An invisible TRUE
or an error message.
the value of the (first) argument to be checked
the name of the (first) argument.
the acceptable length(s) for the argument. If NULL
no test is performed.
the acceptable value(s) for the argument. If NULL
no test is performed. Can also be "character" or "character_or_logical".
should an error be output if value is NULL
.
should an error be output if value contains duplicated values.
the name of the function using the argument.
add ": " after the name of the function in the error message.
For validDimension
: the type of operator used to check the dimensions. For validPath
either "dir" or "file" to check whether to path points to an existing directory or file.
the second value of a second argument whose dimensions should be consistent with the first one
the name of the second argument.
the minimum acceptable value
the maximum acceptable value
should an error be output if value contains NA
.
values that must appear in the argument
values that must not appear in the argument
[logical] flatten argument before check.
filter the files by the type of extension.
display a warning when the separator is not correctly specified in
the acceptable classes(s) for the argument.
the acceptable dimension for the argument. If NULL
then name2 is used as a reference.