h_complete_list: Extends a list with an named element if the element does not...

Description Usage Arguments Value Examples

View source: R/helper.R

Description

Extends a list with an named element if the element does not exist

Usage

1
h_complete_list(ell, name, value)

Arguments

ell

list to be extended (usually an ellipsis as list(...))

name

character with the name for the element to be added

value

value that will be stored in ell[[el_name]]

Value

if ell already contained the element name, then ell is returned without being modified. Otherwise, ell is returned extended by a new element with name name and value value.

Examples

1
2
3
ell <- list(a = 1, b = 2)
sanityTracker:::h_complete_list(ell = ell, name = "a", value = 100)
sanityTracker:::h_complete_list(ell = ell, name = "d", value = Inf)

sanityTracker documentation built on April 22, 2020, 5:09 p.m.