Extract the conditions from a (supported) object.
Usage
conds(object, ...)
# S3 method for class 'drift_dm'
conds(object, ...)
# S3 method for class 'fits_ids_dm'
conds(object, ...)
# S3 method for class 'data.frame'
conds(object, ...)
# S3 method for class 'traces_dm_list'
conds(object, ...)
Value
NULL
or a character vector with the conditions. NULL
is given if the
object has no conditions (e.g., when a data.frame has no Cond
column).
Details
conds()
is a generic accessor function. The default methods get the
"conditions" that are present in an object. Currently supported objects:
fits_ids_dm
(see load_fits_ids)traces_dm_list
(see simulate_traces)
Note
There is no respective replacement function for conds()
. If users want to
modify the conditions of a drift_dm model, they should create a
new flex_prms object and subsequently set it to the model.
This is because there is no meaningful way to know for the package how the
model shall behave for the newly introduced condition(s).
Examples
# get a pre-built model to demonstrate the conds() function
my_model <- dmc_dm()
conds(my_model)
#> [1] "comp" "incomp"
# accessor functions also work with other object types provided by dRiftDM
# (simulated traces; see the documentation of the respective function)
some_traces <- simulate_traces(my_model, k = 1)
conds(some_traces)
#> [1] "comp" "incomp"
# get an exemplary fits_ids_dm object (see estimate_model_ids)
fits <- get_example_fits_ids()
conds(fits)
#> [1] "comp" "incomp"
# also works with data.frames that have a "Cond" column
conds(dmc_synth_data)
#> [1] "comp" "incomp"