Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

isScalarValue

Is given argument an atomic vector or factor of length 1?


Description

More specific functions for scalars of a given type exist, too.

Usage

isScalarValue(x, na.ok = TRUE, null.ok = FALSE, type = "atomic")

isScalarLogical(x, na.ok = TRUE, null.ok = FALSE)

isScalarNumeric(x, na.ok = TRUE, null.ok = FALSE)

isScalarInteger(x, na.ok = TRUE, null.ok = FALSE)

isScalarComplex(x, na.ok = TRUE, null.ok = FALSE)

isScalarCharacter(x, na.ok = TRUE, null.ok = FALSE)

isScalarFactor(x, na.ok = TRUE, null.ok = FALSE)

Arguments

x

[any]
Argument.

na.ok

[logical(1)]
Is NA considered a scalar? Default is TRUE.

null.ok

[logical(1)]
Is NULL considered a scalar? Default is FALSE.

type

[character(1)]
Allows to restrict to specific type, e.g., “numeric”? But instead of this argument you might want to consider using isScalar<Type>. Default is “atomic”, so no special restriction.

Value

[logical(1)].


BBmisc

Miscellaneous Helper Functions for B. Bischl

v1.11
BSD_2_clause + file LICENSE
Authors
Bernd Bischl [aut, cre], Michel Lang [aut], Jakob Bossek [aut], Daniel Horn [aut], Jakob Richter [aut], Dirk Surmann [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.