Learn R Programming

HuraultMisc (version 1.1.1)

is_scalar: Test whether x is of length 1

Description

Test whether x is of length 1

Usage

is_scalar(x)

Arguments

x

Object to be tested.

Value

Logical

Examples

Run this code
# NOT RUN {
is_scalar(1) # TRUE
is_scalar("a") # TRUE
is_scalar(c(1, 2)) # FALSE
# }

Run the code above in your browser using DataLab