dssSwapKeys: Swap list keys

View source: R/little_helpers.R

dssSwapKeysR Documentation

Swap list keys

Description

Swap the first level of names of a list with the second level (second level can be more named lists or a simple vector). Values are merged if necessary (see example)

Usage

dssSwapKeys(l)

Arguments

l

a list

Value

a list with swapped keys and values

Examples

x <- list(a = list(b = c(1,2)), y = list(b = c(2,3)))
dssSwapKeys(x)

sib-swiss/dsSwissKnifeClient documentation built on July 16, 2025, 6:25 p.m.