delist_singletons: Remove singleton lists of a list.

View source: R/delist_singletons.R

delist_singletonsR Documentation

Remove singleton lists of a list.

Description

delist_singletons searches a list for elements that are list of length 1 and "delists" by assigning the contents to the name of the list.

Usage

delist_singletons(x)

Arguments

x

A list.

Value

A list.

Examples

mylist <- list("A" = 1, "B" = list(1:5), "C" = list(little = 1:3, tiny = 4:5))
mylist
delist_singletons(mylist)

barefootbiology/heyexr documentation built on July 9, 2022, 3:35 a.m.