Is the input scalar?
Source:R/check-scalar-isNumber.R
, R/check-scalar-isScalar.R
check-scalar-isScalar.Rd
Scalar represents a length of 1.
Usage
isNumber(x, nullOk = FALSE)
isScalar(x, nullOk = FALSE)
isScalarAtomic(x, nullOk = FALSE)
isScalarCharacter(x, nullOk = FALSE)
isScalarDouble(x, nullOk = FALSE)
isScalarInteger(x, nullOk = FALSE)
isScalarIntegerish(x, nullOk = FALSE)
isScalarList(x, nullOk = FALSE)
isScalarLogical(x, nullOk = FALSE)
isScalarNumeric(x, nullOk = FALSE)
isScalarVector(x, nullOk = FALSE)
isNonScalar(x)
Examples
## TRUE ====
isScalar("a")
#> [1] TRUE
isScalarInteger(1L)
#> [1] TRUE
isScalarIntegerish(1)
#> [1] TRUE
## FALSE ====
isScalar(NULL)
#> [1] FALSE
isScalar(c("a", "b"))
#> [1] FALSE