Check that an argument is a named vector of type numeric
Source:R/helpers.R
h_test_named_numeric.Rd
Usage
h_test_named_numeric(
x,
subset.of = NULL,
must.include = NULL,
permutation.of = NULL,
identical.to = NULL,
disjunct.from = NULL,
lower = 0 + .Machine$double.xmin,
finite = TRUE,
any.missing = FALSE,
len = 2,
...
)
Arguments
- x
(
any
)
object to check.- subset.of
[
character
]
Names provided inx
must be subset of the setsubset.of
.- must.include
[
character
]
Names provided inx
must be a superset of the setmust.include
.- permutation.of
[
character
]
Names provided inx
must be a permutation of the setpermutation.of
. Duplicated names inpermutation.of
are stripped out and duplicated names inx
thus lead to a failed check. Use this argument instead ofidentical.to
if the order of the names is not relevant.- identical.to
[
character
]
Names provided inx
must be identical to the vectoridentical.to
. Use this argument instead ofpermutation.of
if the order of the names is relevant.- disjunct.from
[
character
]
Names provided inx
must may not be present in the vectordisjunct.from
.- lower
[
numeric(1)
]
Lower value all elements ofx
must be greater than or equal to.- finite
[
logical(1)
]
Check for only finite values? Default isFALSE
.- any.missing
[
logical(1)
]
Are vectors with missing values allowed? Default isTRUE
.- len
[
integer(1)
]
Exact expected length ofx
.- ...
further parameters passed to
checkmate::test_numeric()
.
Note
This function is based on checkmate::test_numeric()
and
checkmate::test_names()
functions.