compact_list: Remove empty elements from lists

View source: R/utils_compact.R

compact_listR Documentation

Remove empty elements from lists

Description

Remove empty elements from lists

Usage

compact_list(x, remove_na = FALSE)

Arguments

x

A list or vector.

remove_na

Logical to decide if NAs should be removed.

Examples

compact_list(list(NULL, 1, c(NA, NA)))
compact_list(c(1, NA, NA))
compact_list(c(1, NA, NA), remove_na = TRUE)

easystats/insight documentation built on Dec. 3, 2024, 5:45 p.m.