dot-get_dict_param: Unlist a list of length one containing a named list.

.get_dict_paramR Documentation

Unlist a list of length one containing a named list.

Description

This is used for some YAML parameters which need to be defined this way, otherwise they would get overwritten by default values. Example of such parameter:

PARAM:
  - var_1:
      a: 1
    var_2:
      b: 2

Usage

.get_dict_param(
  param,
  not_empty = FALSE,
  empty_to_null = TRUE,
  name = deparse(substitute(param))
)

Arguments

param

A list of length one containing a named list.

not_empty

A logical scalar: if TRUE, throw error when param is NULL or empty list.

empty_to_null

A logical scalar: if TRUE and param is empty list, return NULL.

name

A passed param symbol, used for error messages.

Value

A named list, or NULL if empty_to_null is TRUE and the conditions are met.


bioinfocz/scdrake documentation built on Sept. 19, 2024, 4:43 p.m.