Learn R Programming

forestsearch (version 0.1.0)

get_param: Get Parameter with Default Fallback

Description

Safely retrieves a named element from a list, returning a default value if the element is missing or NULL.

Usage

get_param(args_list, param_name, default_value)

Value

The value of args_list[[param_name]] if present and non-NULL, otherwise default_value.

Arguments

args_list

List to extract from.

param_name

Character. Name of the element to retrieve.

default_value

Default value to return if element is missing or NULL.