trim_list: Trim list

View source: R/helpers.R

trim_listR Documentation

Trim list

Description

Removes NULL and empty lists from a list recursively.

Usage

trim_list(x)

Arguments

x

List.

Examples

x <- list(
  NULL,
  list(),
  list(list(TRUE, list())),
  list(NULL, NULL, list()),
  1,
  list(2, NULL),
  df = data.frame(a = 1, b = 2),
  integer(),
  list(integer())
)
str(trim_list(x))

columbia-glacier/cgr documentation built on Jan. 17, 2024, 2:42 p.m.