all_identical {flashlight}R 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")

[Package flashlight version 0.9.0 Index]