Tools for creating new parameter objects
These functions are used to construct new parameter objects. Generally,
these functions are called from higher level parameter generating functions
like mtry()
.
new_quant_param( type = c("double", "integer"), range, inclusive, default = unknown(), trans = NULL, values = NULL, label = NULL, finalize = NULL ) new_qual_param( type = c("character", "logical"), values, default = unknown(), label = NULL, finalize = NULL )
type |
A single character value. For quantitative parameters, valid
choices are |
range |
A two-element vector with the smallest or largest possible
values, respectively. If these cannot be set when the parameter is defined,
the |
inclusive |
A two-element logical vector for whether the range values should be inclusive or exclusive. |
default |
A single value with the same class as |
trans |
A |
values |
A vector of possible values that is required when |
label |
An optional named character string that can be used for
printing and plotting. The name should match the object name (e.g.
|
finalize |
A function that can be used to set the data-specific
values of a parameter (such as the |
An object of class "param"
with the primary class being either
"quant_param"
or "qual_param"
. The range
element of the object
is always converted to a list with elements "lower"
and "upper"
.
# Create a function that generates a quantitative parameter # corresponding to the number of subgroups. num_subgroups <- function(range = c(1L, 20L), trans = NULL) { new_quant_param( type = "integer", range = range, inclusive = c(TRUE, TRUE), trans = trans, label = c(num_subgroups = "# Subgroups"), finalize = NULL ) } num_subgroups() num_subgroups(range = c(3L, 5L)) # Custom parameters instantly have access # to sequence generating functions value_seq(num_subgroups(), 5)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.