key_value: key_value

Description Usage Arguments Value Examples

View source: R/helpers.R

Description

Return a list or vector with names becoming $key elements and value elements becoming $value elements.

Usage

1
key_value(lst)

Arguments

lst

A named list or vector.

Value

A list with name elements stored as $key and values stored as $value for each original element in the vector or list.

Examples

1
2
3
4
5
vect <- list('A', 'B', 'C')
names(vect) <- c('X', 'Y', 'Z')
for (el in key_value(vect)) {
  print(paste(el$key, el$value))
}

Ottawa-EPRI/EPmisc documentation built on May 18, 2019, 10:14 a.m.