Learn R Programming

flashlight (version 0.9.0)

all_identical: 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, ...)

Value

A logical vector of length one.

Arguments

x

A nested list of objects.

fun

Function used to extract information of each element of x.

...

Further arguments passed to fun().

Examples

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

Run the code above in your browser using DataLab