Skip to contents

Loops through each specified module ID or all modules if no ID was specified. For each ID, an attempt will be made to extract any models available.

Usage

FM_fetch_mdl(state, session, ids = NULL)

Arguments

state

Current module state after yaml file has been read

session

Shiny session variable

ids

Vector of ID strings for the modules containing models or NULL for all modules with models available.

Value

list containing the current dataset with the following format:

  • isgood: General logical indicator of successfully.

  • hasmdl: Logical indicating if at least one model was found.

  • modules: List of module checksums.

  • mdl: Result of MM_fetch_mdl, see vignette("making_modules", package = "formods")

  • catalog: Dataframe containing the a tabular catalog of the models found.

    • label: Text label for the model.

    • object : Name of the object that contains the compiled rxode2 model.

    • MOD_TYPE: Type of 'formods' module the model came from.

    • id: Source 'formods' Module ID.

    • checksum: Checksum of the module where the model came from.

    • MDLchecksum: Checksum of the model.

    • code: Code to generate the model.

Examples

# We need a module state and a Shiny session variable
# to use this function:
id="UD"
sess_res = UD_test_mksession(session=list(), id=id)
#> → UD: including file
#> → UD:   source: file.path(system.file(package="onbrand"), "templates", "report.docx")
#> → UD:   dest:   file.path("config","report.docx")
#> → UD: including file
#> → UD:   source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
#> → UD:   dest:   file.path("config","report.pptx")
#> → UD: including file
#> → UD:   source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
#> → UD:   dest:   file.path("config","report.yaml")
#> → UD: State initialized
#> → UD: module checksum updated:897d952fecbc804999396a96f9df4b20
session = sess_res$session
state   = sess_res$state
mdl = FM_fetch_mdl(state, session)
mdl$catalog
#> NULL