| check-scalar-hasElements | R Documentation |
Does the input have elements?
hasElements(x, n = NULL)
nElements(x)
x |
Object. |
n |
|
TRUE on success;
FALSE on failure, with cause set.
nElements(): Return the number of elements in object.
Updated 2023-09-29.
prod(), which returns the product of all values in its arguments. This
is called internally to check the number of elements.
assertive.properties::has_elements().
assertive.properties::is_of_dimension().
assertive.properties:::n_elements().
## TRUE ====
hasElements("hello")
hasElements("hello", n = 1)
hasElements(list(a = 1, b = 2), n = 2)
## FALSE ====
hasElements(NULL)
hasElements(list(), n = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.