
Check that an argument is a named vector of type numeric
Source:R/helpers.R
h_test_named_numeric.RdUsage
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 inxmust be subset of the setsubset.of.- must.include
[
character]
Names provided inxmust be a superset of the setmust.include.- permutation.of
[
character]
Names provided inxmust be a permutation of the setpermutation.of. Duplicated names inpermutation.ofare stripped out and duplicated names inxthus lead to a failed check. Use this argument instead ofidentical.toif the order of the names is not relevant.- identical.to
[
character]
Names provided inxmust be identical to the vectoridentical.to. Use this argument instead ofpermutation.ofif the order of the names is relevant.- disjunct.from
[
character]
Names provided inxmust may not be present in the vectordisjunct.from.- lower
[
numeric(1)]
Lower value all elements ofxmust 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.