restrict_list: Restrict a list to the nodes satisfying a given property.

Description Usage Arguments Value

View source: R/restrict_list.R

Description

This function is mainly intended to simplify the task of working with list where some of the nodes are arrays, but it could be that it also could be of use in other cases.

Usage

1
restrict_list(.list, .property = "is.array", .restrict = TRUE)

Arguments

.list

The list-object to work upon.

.property

A character, default "is.character" that gives the name of the test function that tests the property of the different nodes. Note, the function must return a logical value.

.restrict

Logical value, default TRUE, that decides if .list should be restricted to those nodes satisfying .property, or if the restriction instead should be based on the complementary nodes.

Value

A new list will be returned, with only those nodes of .list that satisfied the requirements given by .property and .restrict.


LAJordanger/leanRcoding documentation built on Feb. 27, 2020, 4:42 p.m.