R/facts_engines.R
, R/run_engine_aipf_contin.R
, R/run_engine_aipf_dichot.R
, and 6 more
facts_engines.Rd
These functions are the inner functions called by
run_engine()
. In this help file, only the most common engine functions
are listed. To identify the appropriate engine function
for your FACTS file, call get_facts_engine()
.
run_engine_aipf_contin()
: Enrichment continuous.
run_engine_aipf_dichot()
: Enrichment dichotomous.
run_engine_aipf_tte()
: Enrichment time to event.
run_engine_contin()
: Core continuous.
run_engine_crm()
: continual reassessment method (CRM).
run_engine_dichot()
: Core dichotomous.
run_engine_multep()
: Multiple endpoint.
run_engine_tte()
: Time to event.
run_engine_aipf_contin(
param_files,
n_sims = 1L,
mode = c("", "r"),
seed = NULL,
analysis_data = NULL,
analysis_mode = NULL,
current_week = NULL,
execdata = NULL,
final = NULL,
interim = NULL,
mcmc_num = NULL,
verbose = FALSE,
version = NULL
)
run_engine_aipf_dichot(
param_files,
n_sims = 1L,
mode = c("", "r"),
seed = NULL,
analysis_data = NULL,
analysis_mode = NULL,
current_week = NULL,
execdata = NULL,
final = NULL,
interim = NULL,
mcmc_num = NULL,
verbose = FALSE,
version = NULL
)
run_engine_aipf_tte(
param_files,
n_sims = 1L,
mode = c("", "r"),
seed = NULL,
analysis_data = NULL,
analysis_mode = NULL,
current_week = NULL,
execdata = NULL,
final = NULL,
interim = NULL,
mcmc_num = NULL,
verbose = FALSE,
version = NULL
)
run_engine_contin(
param_files,
n_sims = 1L,
mode = c("s", "r", "p"),
seed = NULL,
analysis_data = NULL,
analysis_mode = NULL,
arm_selection = NULL,
armsdropped = NULL,
complete_data_analysis = NULL,
current_week = NULL,
execdata = NULL,
final = NULL,
fsimdata = NULL,
fsimexp = NULL,
fsimparam = NULL,
interim = NULL,
keepfiles = NULL,
mcmc_num = NULL,
noadapt = NULL,
s2_aux_paramfile = NULL,
stage = NULL,
verbose = FALSE,
version = NULL
)
run_engine_crm(
param_files,
n_sims = 1L,
mode = c("s", ""),
directory = ".",
allocator = NULL,
charting_info = NULL,
estimator = NULL,
force_cohort = NULL,
reduced_priority = NULL,
version = NULL,
verbose = FALSE
)
run_engine_dichot(
param_files,
n_sims = 1L,
mode = c("s", "r", "p"),
seed = NULL,
analysis_data = NULL,
analysis_mode = NULL,
arm_selection = NULL,
armsdropped = NULL,
complete_data_analysis = NULL,
current_week = NULL,
execdata = NULL,
final = NULL,
fsimdata = NULL,
fsimexp = NULL,
fsimparam = NULL,
interim = NULL,
keepfiles = NULL,
mcmc_num = NULL,
noadapt = NULL,
s2_aux_paramfile = NULL,
stage = NULL,
verbose = FALSE,
version = NULL
)
run_engine_multep(
param_files,
n_sims = 1L,
mode = c("s", "r", "p"),
seed = NULL,
analysis_data = NULL,
analysis_mode = NULL,
arm_selection = NULL,
armsdropped = NULL,
complete_data_analysis = NULL,
current_week = NULL,
execdata = NULL,
final = NULL,
fsimdata = NULL,
fsimexp = NULL,
fsimparam = NULL,
interim = NULL,
keepfiles = NULL,
mcmc_num = NULL,
noadapt = NULL,
s2_aux_paramfile = NULL,
stage = NULL,
verbose = FALSE,
version = NULL
)
run_engine_tte(
param_files,
n_sims = 1L,
mode = c("s", "r", "p"),
seed = NULL,
analysis_data = NULL,
analysis_mode = NULL,
arm_selection = NULL,
armsdropped = NULL,
complete_data_analysis = NULL,
current_week = NULL,
execdata = NULL,
final = NULL,
fsimdata = NULL,
fsimexp = NULL,
fsimparam = NULL,
interim = NULL,
keepfiles = NULL,
mcmc_num = NULL,
noadapt = NULL,
s2_aux_paramfile = NULL,
stage = NULL,
verbose = FALSE,
version = NULL
)
Character vector of file paths or the output
of prep_param_files()
. If a character vector, the elements
can be directories containing *.param
files or the paths to the
*.param
files themselves.
Such a directory is returned by run_flfll()
.
Positive integer, number of simulations per param file.
Character scalar: "s"
for simulation mode in non-enrichment
designs, ""
for simulation mode in enrichment designs,
"r"
for execution mode, and "p"
for prediction mode.
For the CRM engine, mode
needs to be "s"
or ""
.
Positive integer, random number generator seed for the
actual trial simulations. Use this seed
argument instead of
flfll_seed
(run_facts()
, run_flfll()
) to control
pseudo-randomness in the actual trial simulations. flfll_seed
only controls how the *.param
files are generated.
Character, analysis mode patient data file name.
Logical, whether to activate analysis mode.
Numeric, current time in weeks.
Character, name of the execution mode patient file.
Logical, whether to do the final analysis. For execution mode only.
Integer, interim number.
Integer, MCMC file number. For analysis mode only.
Logical, whether to print progress information to the R console.
Character scalar, version of FACTS corresponding to the
FACTS file. Get by calling get_facts_version()
on your FACTS file.
See possible versions with get_facts_versions()
.
Do not supply version
to run_engine()
. run_engine()
detects the version automatically from the FACTS file and
passes it to the appropriate engine function.
Logical, whether to activate arm selection.
Character, a comma-separated collection of integers indicating dropped arms.
Logical, whether to do a complete data analysis.
Character, prediction mode patient data file name.
Logical. For expert use only.
Character, name of the prediction mode *.param
file.
Logical, whether to deactivate cleanup of extraneous staged design files.
Logical, whether to deactivate adaptive actions in prediction mode.
Character, name of the stage 2 execution
auxiliary *.param
file.
Integer, trial design stage. For staged designs only.
Character, working directory. CRM only.
Logical, allocator/execution/recommender mode. CRM only.
Logical, unused.
Logical, use estimator. CRM only.
Logical, whether to force small cohort run-in to end. CRM only.
Logical, whether to run at reduced priority. CRM only.
Nothing.
If you need to repeatedly invoke an engine, as with most
trial execution mode workflows, these engine functions may be slow
on their own. To avoid the most severe sources of slowness,
consider running prep_param_files()
and then passing the result to one of the individual engine
functions (such as run_engine_contin()
).
facts_file <- get_facts_file_example("contin.facts")
# Can only run if system dependencies are configured:
if (file.exists(Sys.getenv("RFACTS_PATHS"))) {
out <- run_flfll(facts_file, verbose = FALSE) # Generate param files.
# Identify which engine you need.
get_facts_engine(facts_file)
# Run the sims with the engine function or `run_engine()`.
run_engine_contin(out, n_sims = 1, verbose = FALSE, version = "6.2.5")
read_patients(out)
}