scalar-type-predicates | R Documentation |
These predicates check for a given type and whether the vector is "scalar", that is, of length 1.
In addition to the length check, is_string()
and is_bool()
return FALSE
if their input is missing. This is useful for
type-checking arguments, when your function expects a single string
or a single TRUE
or FALSE
.
is_scalar_list(x)
is_scalar_atomic(x)
is_scalar_vector(x)
is_scalar_integer(x)
is_scalar_double(x)
is_scalar_complex(x)
is_scalar_character(x)
is_scalar_logical(x)
is_scalar_raw(x)
is_string(x, string = NULL)
is_scalar_bytes(x)
is_bool(x)
x |
object to be tested. |
string |
A string to compare to |
type-predicates, bare-type-predicates
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.