Learn R Programming

MRIaggr (version 1.1.5)

valid: Checking argument validity

Description

Check the validity of an argument. For internal use.

Usage

validCharacter(value, name = as.character(substitute(value)), validLength, validValues = "character", refuse.NULL = TRUE, method)
validClass(value, name = as.character(substitute(value)), validClass, superClasses = TRUE, method)
validDim_vector(value1, value2, name1 = as.character(substitute(value1)), name2 = as.character(substitute(value2)), type = "length", method)
validDim_matrix(value1, value2, name1 = as.character(substitute(value1)), name2 = as.character(substitute(value2)), type = "both", method)
validInteger(value, name = as.character(substitute(value)), validLength, validValues = NULL, min = NULL, max = NULL, refuse.NA = TRUE, refuse.NULL = TRUE, refuse.duplicates = FALSE, method) validLogical(value, name = as.character(substitute(value)), validLength, refuse.NULL = TRUE, refuse.NA = TRUE, method)
validNames(value, name = as.character(substitute(value)), validLength = NULL, validValues = NULL, method)
validNumeric(value, name = as.character(substitute(value)), validLength, validValues = NULL , min = NULL, max = NULL, refuse.NA = TRUE, refuse.NULL = TRUE, refuse.duplicates = FALSE, method) validPath(value, name = as.character(substitute(value)), method)

Arguments

value, value1, value2
the value of the argument(s).
name, name1, name2
the name(s) of the argument(s). character.
validLength
the valid lengthes for the argument. integer vector.
validClass
the valid classes for the argument. character vector.
validValues
the valid values for the argument. character vector.
refuse.NA
Is NA an invalid value ? logical.
refuse.NULL
Is NULL an invalid value ? logical.
refuse.duplicates
Are duplicated values invalid values. logical.
type
the operator used to compare the size. character. See the details section for more information.
min
the minimum value for the argument. numeric or NULL.
max
the maximum value for the argument. numeric or NULL.
superClasses
Should the super-classes of the object's class be also considered or only the object's class ? logical.
method
the name of the function that called the valid function. character.

Details

validCharacter checks whether value is a character vector.

validClass checks whether value belongs to the correct class of R objects.

validDim_vector checks whether value1 is a vector matching the dimensions of value2. Argument type indicates which operator should be used to measure the size of value2 among : "length", "nrow" and "ncol".

validDim_matrix checks whether value1 is a matrix matching the dimensions of value2. Argument type indicates which operator should be used to measure the size of value2 among : "nrow", "ncol" and "both", the latter indicating to use both nrow and ncol.

validInteger checks whether value is a integer vector.

validLogical checks whether value is a logical vector.

validNames checks whether the names value are valid.

validNumeric checks whether value is a numeric vector.

validPath checks whether value corresponds to a valid path.