revertListAssignments: Revert List Assignments

View source: R/convert.R

revertListAssignmentsR Documentation

Revert List Assignments

Description

Switch list elements with their names

Usage

revertListAssignments(x)

Arguments

x

list of named elements

Value

list with the names of x as elements and the elements of x as names

Examples

abbreviation <- list(de = "Germany", en = "England")

revertListAssignments(abbreviation)

## reverting twice results in the original list
identical(
  abbreviation, 
  revertListAssignments(revertListAssignments(abbreviation))
)


KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.