Description Usage Arguments Value
Various tests.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | is.character.vector(x)
is.nonempty.string(x)
is.vector.of.nonempty.strings(x)
is.plain.list(x)
is.named.list(x)
is.integer.valued(x)
is.logical.vector(x)
is.empty.string(x)
## S3 method for class 'vector'
is.numeric(x)
is.real.number(x)
is.inf(x)
|
x |
object to test. |
These are typically used in statements with assert_that(...).
Each function returns either TRUE or FALSE; some functions
may return NA.
#'
is.character.vector: TRUE if and only if x is a
character vector of positive length, otherwise FALSE.
is.nonempty.string: TRUE if and only if x is a
character vector of length 1 with a component that is nonempty and non-NA,
otherwise FALSE.
is.vector.of.nonempty.strings: TRUE if and only if
x is a vector of nonempty strings none of which is an NA, otherwise
FALSE. Empty vectors yield FALSE.
is.plain.list: TRUE if and only if x is a list
but does not have the object class set. Otherwise FALSE.
is.plain.list: TRUE if and only if x is a list
but does not have the object class set. Otherwise FALSE.
is.named.list: TRUE if and only if x is a plain
list with a names attribute with non-empty strings for names, otherwise
FALSE.
is.integer.valued: TRUE if and only if x is
either of type integer, or numeric and all components coercible to
integer, otherwise FALSE. NAs are allowed.
is.logical.vector: TRUE if and only if x is a
logical vector of positive length, otherwise FALSE.
is.empty.string: A logical vector of the same length as
x, #' with 'TRUE' if and only if the string is empty,
NA if the string is NA, otherwise FALSE. If x is not
character, throws an error. NA maps to NA.
is.numeric.vector: TRUE if and only if x is a
numeric vector of positive length, otherwise FALSE.
is.real.number: TRUE if and only if x is a
numeric scalar, not an NA, and not infinite, otherwise FALSE.
is.inf: TRUE if and only if x is Inf or
-Inf.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.