Class definition of 'RAVE' constrained variable collection
Source:R/class-variable-collection.R
RAVEVariableCollection.Rd
See new_variable_collection
for construction
Value
Formatted characters
Self
The removed variable
TRUE
if found, otherwise FALSE
Self
The variable value if variable if found and
get_definition
is false; or the variable definition if variable
is found and is RAVEVariable
or RAVEVariableCollection
;
or ifnotfound
if the variable does not exist
The variable values in list
Nothing
TRUE
if valid, or raises errors by default
TRUE
if valid, otherwise returns the error message
A list of constraint data that can be passed into
$restore
method
RAVEVariableCollection
instance
Public fields
explicit
whether getting and setting values should be explicit. If true, then all variables must be defined (see
$add_variable
) before used.
Active bindings
.wrapper
wrapper instance of current variable collection
generator
class definition
isRAVEVariableCollection
always true
variables
map containing the variable definitions
varnames
variable names
name
descriptive name of the collection
Methods
Method add_variable()
Registers a variable, must run if the collection is explicit
Arguments
id
variable 'ID'
var
a
RAVEVariable
orRAVEVariableCollection
instance if the variable is bounded, or simply normal R object ( then the variable will have no constraint)
Method set_value()
Set value of a variable
Usage
RAVEVariableCollection$set_value(id, value, env = parent.frame(), ...)
Method get_value()
Get value of a variable
Usage
RAVEVariableCollection$get_value(
id,
env = parent.frame(),
get_definition = FALSE,
ifnotfound = NULL
)
Method validate()
Run validation
Usage
RAVEVariableCollection$validate(
env = parent.frame(),
on_error = c("error", "warning", "message", "muffle")
)
Method check()
Check if the value is valid with no error raised
Usage
RAVEVariableCollection$check(env = parent.frame())
Method restore()
Restores from atomic list generated by $store()
Usage
RAVEVariableCollection$restore(x, env = parent.frame(), clear = FALSE, ...)