build_param_names: Build the parameter names

Description Usage Arguments Details Value Examples

View source: R/parameters.R

Description

This function is called internally by other functions. It creates the names of the parameters based on the name of the meta parameter and its type. For example, if the meta parameter "w1" must take a different value for males and females (i.e. type = "s"), then the function will create the parameter names "w1.males" and "w1.females".

Usage

1
build_param_names(meta_param_name, meta_param_type, check = TRUE)

Arguments

meta_param_name

The name of the meta parameter

meta_param_type

The type of subcategories for the meta parameters

check

Whether the arguments should be checked against expected types

Details

For a given meta parameter, we only implemented the different types which we consider relevant for our purpose: the meta parameters "w1", "b2", "w2", "b2" can take the types "0", "1", or "s" (value fixed at zero, a unique parameter value, and one parameter value per sex); "w3" can either be "0+t+l", "1+t+l", or "s+t+l" (one parameter fixed at 0, or a unique parameter, or one per sex, followed by one parameter value per birth cohort and location); "w4", "w5", "b4" and "b5 can take "0", "1", "s", "c" (value fixed at zero, a unique value, one per sex, one per capture method). (The syntax "s:c" is also used for creating sex capture-method combination but should be only used internally.)

Value

A vector of parameter names.

Examples

1
2
3
4
5
6
7
8
build_param_names(meta_param_name = "w1", meta_param_type = "0")
build_param_names(meta_param_name = "w1", meta_param_type = "1")
build_param_names(meta_param_name = "w1", meta_param_type = "s")
build_param_names(meta_param_name = "w3", meta_param_type = "1+t+l")
#build_param_names(meta_param_name = "w3", meta_param_type = "t+l") ## error as it should
build_param_names(meta_param_name = "w3", meta_param_type = "t+l", check = FALSE)
#build_param_names(meta_param_name = "w3",
#                 meta_param_type = "something_wrong") ## error as it should

courtiol/SileR documentation built on May 16, 2020, 8:10 p.m.