Assertions | R Documentation |
These are a group of helper functions that allow the developer to easily check for common data types in Bioconductor. These include logical, character, and numeric (& integer).
isTRUEorFALSE(x, na.ok = FALSE)
isScalarCharacter(x, na.ok = FALSE, zchar = FALSE)
isScalarInteger(x, na.ok = FALSE)
isScalarNumber(x, na.ok = FALSE, infinite.ok = FALSE)
isScalarLogical(x, na.ok = FALSE)
isCharacter(x, na.ok = FALSE, zchar = FALSE)
isZeroOneCharacter(x, na.ok = FALSE, zchar = FALSE)
x |
The input vector whose type is to be checked |
na.ok |
logical(1L) Whether it is acceptable to consider |
zchar |
logical(1L) Whether is is acceptable to consider 'zero'
characters as defined by |
infinite.ok |
logical(1L) Whether it is acceptable to consider infinite
values as identified by |
Some functions such as isScalarCharacter
allow exceptions to the type
checks via the na.ok
and zchar
arguments. Others, for example
isScalarNumber
can permit Inf
with the infinite.ok
argument.
Either TRUE
or FALSE
isTRUEorFALSE()
: Is the input a single logical vector?
isScalarCharacter()
: Is the input a single character vector?
isScalarInteger()
: Is the input a single integer vector?
isScalarNumber()
: Is the input a single numeric vector?
isScalarLogical()
: Is the input a single logical vector?
isCharacter()
: Is the input a character vector?
isZeroOneCharacter()
: Is the input a character vector of zero or one length?
M. Morgan, H. Pagès
isTRUEorFALSE(TRUE)
isTRUEorFALSE(FALSE)
isTRUEorFALSE(NA, na.ok = TRUE)
isScalarCharacter(LETTERS)
isScalarCharacter("L")
isCharacter(LETTERS)
isCharacter(NA_character_, na.ok = TRUE)
isZeroOneCharacter("")
isZeroOneCharacter("", zchar = TRUE)
isScalarInteger(1L)
isScalarInteger(1)
isScalarNumber(1)
isScalarNumber(1:2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.