is_leaf: Checks if argument fits the definition of a list leaf

Description Usage Arguments Value See Also Examples

View source: R/list_helpers.R

Description

Leaf in a list is a vector (non-list) or an object.

Usage

1

Arguments

x

any R data

Value

TRUE or FALSE

See Also

is.object() for the explanation of 'internally classed' object

Examples

1
2
3
4
is_leaf(FALSE) # TRUE, because c(TRUE) is a vector, not a list
is_leaf(LETTERS) # TRUE, for the same reason
is_leaf(mtcars)# TRUE, because data.frame is an 'internally classed' R object
is_leaf(as.list(mtcars)) # FALSE, because argument is a list

avidclam/avidstart documentation built on May 17, 2019, 10:01 a.m.