Scalar represents a length of 1.

isNumber(x, nullOK = FALSE)

isScalar(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))

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

Arguments

x

Object.

nullOK

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

.xname

Name of object defined in x. Not intended to be used directly.

Value

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

Functions

  • isNumber: Alias for isScalarNumeric().

Note

Updated 2019-08-10.

See also

Examples

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