Scalar represents a length of 1.

isNumber(x, nullOK = FALSE)

isScalar(x, .xname = getNameInParent(x))

isNonScalar(x, .xname = getNameInParent(x))

isScalarList(x, .xname = getNameInParent(x))

isScalarAtomic(x, .xname = getNameInParent(x))

isScalarVector(x, .xname = getNameInParent(x))

isScalarNumeric(x, .xname = getNameInParent(x))

isScalarInteger(x, .xname = getNameInParent(x))

isScalarIntegerish(x)

isScalarDouble(x, .xname = getNameInParent(x))

isScalarCharacter(x, .xname = getNameInParent(x))

isScalarLogical(x, .xname = getNameInParent(x))

Arguments

x

Object.

nullOK

logical(1). If set to TRUE, x may also be NULL.

.xname

Not intended to be used directly.

Value

TRUE on success; FALSE on failure, with cause attribute set.

Functions

  • isNumber: Alias for isScalarNumeric().

See also

Examples

## TRUE ==== isScalar("a")
#> [1] TRUE
isScalarInteger(1L)
#> [1] TRUE
isScalarIntegerish(1)
#> [1] TRUE
## FALSE ==== isScalar(NULL)
#> [1] FALSE #> Cause of failure: #> NULL does not have a length of 1.
isScalar(c("a", "b"))
#> [1] FALSE #> Cause of failure: #> c("a", "b") does not have a length of 1.