| Milestones | R Documentation |
Create a class of milestone. A milestone means the time point to take an action, e.g., carrying out (futility, interim, final) analysis for adding/removing arms, or stopping a trial early. It can also be any more general time point where trial data is used in decision making or adaptation. For example, one can define a milestone for changing randomization scheme, sample size re-assessment, trial duration extension etc.
Public methods in this R6 class are used in developing
this package. Thus, we have to export the whole R6 class which exposures all
public methods. However, none of the public methods on this page is
useful to end users. Instead, refer to the
vignette
to learn how to define milestones when performing simulation using
TrialSimulator.
new()initialize milestone
Milestones$new(name, type = name, trigger_condition, action = doNothing, ...)
namecharacter. Name of milestone.
typecharacter vector. Milestone type(s) (futility, interim, final), a milestone can be of multiple types. This is for information purpose so can be any string.
trigger_conditionfunction to check if this milestone should
trigger. See vignette Condition System for Triggering Milestones in a Trial.
actionfunction to execute when the milestone triggers.
...(optional) arguments of action.
get_name()return name of milestone
Milestones$get_name()
get_type()return type(s) of milestone
Milestones$get_type()
get_trigger_condition()return trigger_condition function
Milestones$get_trigger_condition()
get_action()return action function
Milestones$get_action()
set_dry_run()set if dry run should be carried out for the milestone. For more details,
refer to Controller::run.
Milestones$set_dry_run(dry_run)
dry_runlogical.
execute_action()execute action function
Milestones$execute_action(trial)
triala Trial object.
get_trigger_status()return trigger status
Milestones$get_trigger_status()
reset()reset an milestone so that it can be triggered again. Usually, this is called before the controller of a trial can run additional replicates of simulation.
Milestones$reset()
trigger_milestone()trigger an milestone (always TRUE) and execute action accordingly. It calls Trial$get_data_lock_time() to lock data based on conditions implemented in Milestones$trigger_condition. If time that meets the condition cannot be found, Trial$get_data_lock_time() will throw an error and stop the program. This means that user needs to adjust their trigger_condition (e.g., target number of events (target_n_events) is impossible to reach).
Milestones$trigger_milestone(trial)
triala Trial object.
mute()mute all messages (not including warnings)
Milestones$mute(silent)
silentlogical.
clone()The objects of this class are cloneable with this method.
Milestones$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.