FixupList: FixupList

View source: R/Helpers.R

FixupListR Documentation

FixupList

Description

Checks a list for falsy or missing values and replaces them by values taken from a default. Remove extraneous elements in x that aren't part of the default. Add missing elements in x. Replace falsy values in x by default values.

Usage

FixupList(x, Default)

Arguments

x

A named list to fix

Default

A named list of default values

Value

The fixed list

Examples

# FixupList(list(a=1, b=NA, c=3, d=NA), list(a=4, d=8, c=9, x=7))
#> list(a=1, c=3, d=8, x=7)

SigurdJanson/shinyCSVImpoMod documentation built on Jan. 5, 2023, 3:57 a.m.