is.variable: Variables

View source: R/utils.R

is.variableR Documentation

Variables

Description

From rapport's point of view, a variable is a non-NULL atomic vector that has no dimension attribute (see dim for details). This approach bypasses factor issues with is.vector, and also eliminates multidimensional vectors, such as matrices and arrays.

Usage

is.variable(x)

Arguments

x

an object to be checked for "variable" format

Value

a logical value indicating that provided object is a "variable"

Examples

is.variable(rnorm(100))  # [1] TRUE
is.variable(LETTERS)     # [1] TRUE
is.variable(NULL)        # [1] FALSE
is.variable(mtcars)      # [1] FALSE
is.variable(HairEyeColor[, , 1])  # [1] FALSE
is.variable(list())      # [1] FALSE

Rapporter/rapportools documentation built on March 23, 2022, 2:23 a.m.