get_param.RdGet package parameter
get_param(param, package = NULL, fallback = NULL)
| param | parameter to get |
|---|---|
| package | package of the parameter (NULL if running from a package) |
| fallback | what to do if parameter not found |
value of param in package package and fallback if parameter not found
register_param('param1', 'tgconfig') set_param('param1', 'value1', 'tgconfig') get_param('param1', 'tgconfig')#> [1] "value1"# try to get a parameter that doesn't exist get_param('other_param', 'tgconfig')#> NULL# sometimes we want to throw and error if the parameter doesn't exist # get_param('other_param', 'tgconfig', fallback=stop()) # would trow and error