Learn R Programming

nlist (version 0.1.1)

chk_natomic: Check Numeric Atomic, nlist Object or nlists Object

Description

chk_natomic checks if numeric object using

is.numeric(x) && is.atomic(x).

chk_natomic checks if an nlist-object() while ignoring the class.

chk_nlists checks if an nlists-object() while ignoring the class.

Usage

chk_natomic(x, x_name = NULL)

chk_nlist(x, x_name = NULL)

chk_nlists(x, x_name = NULL)

Arguments

x

The object to check.

x_name

A string of the name of object x or NULL.

Value

NULL, invisibly. Called for the side effect of throwing an error if the condition is not met.

Functions

  • chk_natomic: Check Numeric Atomic

  • chk_nlist: Check nlist Object

  • chk_nlists: Check nlists Object

See Also

vld_natomic()

Examples

Run this code
# NOT RUN {
# chk_natomic
chk_natomic(1)
chk_natomic(matrix(1L))
try(chk_natomic(TRUE))

# chk_nlist
chk_nlist(nlist(x = 1))
try(chk_nlist(list(x = 1)))

# chk_nlists
chk_nlists(nlists(nlist(x = 1)))
# }

Run the code above in your browser using DataLab