get_param: Get package parameter

Description Usage Arguments Value Examples

View source: R/tgconfig.R

Description

Get package parameter

Usage

1
get_param(param, package = NULL, fallback = NULL)

Arguments

param

parameter to get

package

package of the parameter (NULL if running from a package)

fallback

what to do if parameter not found

Value

value of param in package package and fallback if parameter not found

Examples

1
2
3
4
5
6
7
8
9
register_param('param1', 'tgconfig')
set_param('param1', 'value1', 'tgconfig')
get_param('param1', 'tgconfig')

# try to get a parameter that doesn't exist
get_param('other_param', 'tgconfig')

# sometimes we want to throw and error if the parameter doesn't exist
# get_param('other_param', 'tgconfig', fallback=stop()) # would trow and error

tanaylab/tgconfig documentation built on Nov. 5, 2019, 9:59 a.m.