Learn R Programming

mizer (version 3.4.0)

default_info_level: The default level of information that mizer gives

Description

[Experimental] Returns the mizer_info_level option if it is set and fallback otherwise. This is the default of the info_level argument of the functions that report information, so that options(mizer_info_level = 0) quietens mizer as a whole, including the functions that have no info_level argument of their own, such as species_params<-() and the rate setters.

Usage

default_info_level(fallback = 3)

Value

A single number, or NA to leave the reporting to a handler further out.

Arguments

fallback

The level to use when the option is not set. Defaults to 3, which reports everything.

Details

Extension packages should use this as the default of their own info_level argument, so that a constructor or setter of theirs follows the option like mizer's own do:

newFooParams <- function(species_params, ...,
                         info_level = default_info_level()) {
    newMultispeciesParams(species_params, info_level = info_level, ...)
}

Take the argument explicitly like that rather than hard-coding a value in the call, which would make a user's own info_level collide with it.

Examples

Run this code
default_info_level()

# Setting the option changes what every reporting function defaults to.
old <- options(mizer_info_level = 1)
default_info_level()
options(old)

Run the code above in your browser using DataLab