h_complete_list {sanityTracker} | R Documentation |
Extends a list with an named element if the element does not exist
Description
Extends a list with an named element if the element does not exist
Usage
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 |
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
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)
[Package sanityTracker version 0.1.0 Index]