listOf: Tests equality of list elements class

View source: R/utils.R

listOfR Documentation

Tests equality of list elements class

Description

Compares equality of all members of a list.

Usage

listOf(x, class, valid = TRUE)

Arguments

x

A list.

class

A character defining the expected class.

valid

A logical defining if all elements should be tested for validity. Default is TRUE.

Value

TRUE is all elements of x inherit from class.

Author(s)

Laurent Gatto

Examples

listOf(list(), "foo")
listOf(list("a", "b"), "character")
listOf(list("a", 1), "character")

lgatto/MSnbase documentation built on Nov. 12, 2024, 10:58 a.m.