warn_if_inconsistent_list: Warn If Two Lists are Inconsistent

Description Usage Arguments Value Author(s) Examples

View source: R/warnings.R

Description

Checks if two list inputs have the same names and same number of elements and issues a warning otherwise.

Usage

1
warn_if_inconsistent_list(base, compare, list_name, i = 2)

Arguments

base

A named list

compare

A named list

list_name

A string the name of the list

i

the index id to compare the 2 lists

Value

a warning if the 2 lists have different names or length

Author(s)

Samia Kabi

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# no warning
warn_if_inconsistent_list(
  base = vars(DTHDOM = "DM", DTHSEQ = DMSEQ),
  compare = vars(DTHDOM = "DM", DTHSEQ = DMSEQ),
  list_name = "Test"
)
# warning
warn_if_inconsistent_list(
  base = vars(DTHDOM = "DM", DTHSEQ = DMSEQ, DTHVAR = "text"),
  compare = vars(DTHDOM = "DM", DTHSEQ = DMSEQ),
  list_name = "Test"
)

epijim/admiral documentation built on Feb. 13, 2022, 12:15 a.m.