validate_control {aghq}R Documentation

Validate a control list

Description

This function checks that the names and value types for a supplied control list are valid and are unlikely to cause further errors within aghq and related functions. Users should not have to worry about this and should just use default_control() and related constructors.

Usage

validate_control(control, type = c("aghq", "marglaplace", "tmb"), ...)

Arguments

control

A list.

type

One of c('aghq','marglapace','tmb'). The type of control object to validate. Will basically validate against the arguments required by aghq, marginal_laplace, and marginal_laplace_tmb, respectively.

...

Not used.

Details

To users reading this: just use default_control(), default_control_marglaplace(), or default_control_tmb() as appropriate, to ensure that your control arguments are correct. This function just exists to provide more descriptive error messages in the event that an incompatible list is provided.

Value

Logical, TRUE if the list of control arguments is valid, else FALSE.

Examples

validate_control(default_control())
validate_control(default_control_marglaplace(),type = "marglaplace")
validate_control(default_control_tmb(),type = "tmb")


[Package aghq version 0.4.1 Index]