checkListElementClass: Check that a list contains only elements of a required type.

View source: R/checkListElementClass.R

checkListElementClassR Documentation

Check that a list contains only elements of a required type.

Description

Check that argument is a list and contains only elements of a required type. Throws exception if check is not passed. Note that argument is evaluated when checked.

Usage

checkListElementClass(xs, cl)

Arguments

xs

[list]
Argument.

cl

[character(1)]
Class that elements must have. Checked with is.

Value

Nothing.

Examples

xs = as.list(1:3)
checkListElementClass(xs, "numeric")

BBmisc documentation built on Sept. 29, 2022, 5:12 p.m.