h_test_named_numeric | R Documentation |
A simple helper function that tests whether an object is a named numerical vector.
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,
...
)
x |
( |
subset.of |
[ |
must.include |
[ |
permutation.of |
[ |
identical.to |
[ |
disjunct.from |
[ |
lower |
[ |
finite |
[ |
any.missing |
[ |
len |
[ |
... |
further parameters passed to |
TRUE
if x
is a named vector of type numeric, otherwise FALSE
.
This function is based on checkmate::test_numeric()
and
checkmate::test_names()
functions.
h_test_named_numeric(1:2, permutation.of = c("a", "b"))
h_test_named_numeric(c(a = 1, b = 2), permutation.of = c("a", "b"))
h_test_named_numeric(c(a = 1, b = 2), permutation.of = c("b", "a"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.