all_identical: all_identical

View source: R/all_identical.R

all_identicalR Documentation

all_identical

Description

Checks if an aspect is identical for all elements in a nested list. The aspect is specified by fun, e.g., [[, followed by the element name to compare.

Usage

all_identical(x, fun, ...)

Arguments

x

A nested list of objects.

fun

Function used to extract information of each element of x.

...

Further arguments passed to fun().

Value

A logical vector of length one.

Examples

x <- list(a = 1, b = 2)
y <- list(a = 1, b = 3)
all_identical(list(x, y), `[[`, "a")
all_identical(list(x, y), `[[`, "b")

flashlight documentation built on May 31, 2023, 6:19 p.m.