Skip to contents

Returns the entire state of the App

Usage

FM_fetch_app_state(session)

Arguments

session

Shiny session variable.

Value

App state or NULL if it's not defined.

Examples

# We need a Shiny session object 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
app_state = FM_fetch_app_state(session)
app_state
#> $FM_UD
#> $FM_UD$yaml
#> $FM_UD$yaml$FM
#> $FM_UD$yaml$FM$include
#> $FM_UD$yaml$FM$include$files
#> $FM_UD$yaml$FM$include$files[[1]]
#> $FM_UD$yaml$FM$include$files[[1]]$file
#> $FM_UD$yaml$FM$include$files[[1]]$file$source
#> [1] "file.path(system.file(package=\"onbrand\"), \"templates\", \"report.docx\")"
#> 
#> $FM_UD$yaml$FM$include$files[[1]]$file$dest
#> [1] "file.path(\"config\",\"report.docx\")"
#> 
#> 
#> 
#> $FM_UD$yaml$FM$include$files[[2]]
#> $FM_UD$yaml$FM$include$files[[2]]$file
#> $FM_UD$yaml$FM$include$files[[2]]$file$source
#> [1] "file.path(system.file(package=\"onbrand\"), \"templates\", \"report.pptx\")"
#> 
#> $FM_UD$yaml$FM$include$files[[2]]$file$dest
#> [1] "file.path(\"config\",\"report.pptx\")"
#> 
#> 
#> 
#> $FM_UD$yaml$FM$include$files[[3]]
#> $FM_UD$yaml$FM$include$files[[3]]$file
#> $FM_UD$yaml$FM$include$files[[3]]$file$source
#> [1] "file.path(system.file(package=\"onbrand\"), \"templates\", \"report.yaml\")"
#> 
#> $FM_UD$yaml$FM$include$files[[3]]$file$dest
#> [1] "file.path(\"config\",\"report.yaml\")"
#> 
#> 
#> 
#> 
#> 
#> $FM_UD$yaml$FM$deployed
#> [1] FALSE
#> 
#> $FM_UD$yaml$FM$code
#> $FM_UD$yaml$FM$code$theme
#> [1] "vibrant_ink"
#> 
#> $FM_UD$yaml$FM$code$showLineNumbers
#> [1] TRUE
#> 
#> $FM_UD$yaml$FM$code$gen_file
#> [1] "run_analysis.R"
#> 
#> $FM_UD$yaml$FM$code$gen_preamble
#> [1] "# formods automated output ------------------------------------------------\n# https://formods.ubiquity.tools/\nrm(list=ls())"
#> 
#> $FM_UD$yaml$FM$code$packages
#> [1] "onbrand" "writexl"
#> 
#> 
#> $FM_UD$yaml$FM$notifications
#> $FM_UD$yaml$FM$notifications$config
#> $FM_UD$yaml$FM$notifications$config$success
#> $FM_UD$yaml$FM$notifications$config$success$useFontAwesome
#> [1] FALSE
#> 
#> $FM_UD$yaml$FM$notifications$config$success$useIcon
#> [1] FALSE
#> 
#> $FM_UD$yaml$FM$notifications$config$success$background
#> [1] "#5bb85b"
#> 
#> 
#> $FM_UD$yaml$FM$notifications$config$failure
#> $FM_UD$yaml$FM$notifications$config$failure$useFontAwesome
#> [1] FALSE
#> 
#> $FM_UD$yaml$FM$notifications$config$failure$useIcon
#> [1] FALSE
#> 
#> $FM_UD$yaml$FM$notifications$config$failure$background
#> [1] "#d9534f"
#> 
#> 
#> $FM_UD$yaml$FM$notifications$config$info
#> $FM_UD$yaml$FM$notifications$config$info$useFontAwesome
#> [1] FALSE
#> 
#> $FM_UD$yaml$FM$notifications$config$info$useIcon
#> [1] FALSE
#> 
#> $FM_UD$yaml$FM$notifications$config$info$background
#> [1] "#5bc0de"
#> 
#> 
#> $FM_UD$yaml$FM$notifications$config$warning
#> $FM_UD$yaml$FM$notifications$config$warning$useFontAwesome
#> [1] FALSE
#> 
#> $FM_UD$yaml$FM$notifications$config$warning$useIcon
#> [1] FALSE
#> 
#> $FM_UD$yaml$FM$notifications$config$warning$background
#> [1] "#f0ac4d"
#> 
#> 
#> 
#> 
#> $FM_UD$yaml$FM$reporting
#> $FM_UD$yaml$FM$reporting$enabled
#> [1] TRUE
#> 
#> $FM_UD$yaml$FM$reporting$content_init
#> $FM_UD$yaml$FM$reporting$content_init$xlsx
#> [1] "rpt = list(summary = NULL,\n           sheets  = list())"
#> 
#> $FM_UD$yaml$FM$reporting$content_init$docx
#> [1] "rpt  = onbrand::read_template(\n  template = file.path(\"config\", \"report.docx\"),\n  mapping  = file.path(\"config\", \"report.yaml\"))"
#> 
#> $FM_UD$yaml$FM$reporting$content_init$pptx
#> [1] "rpt  = onbrand::read_template(\n  template = file.path(\"config\", \"report.pptx\"),\n  mapping  = file.path(\"config\", \"report.yaml\"))"
#> 
#> 
#> 
#> $FM_UD$yaml$FM$ui
#> $FM_UD$yaml$FM$ui$button_style
#> [1] "fill"
#> 
#> $FM_UD$yaml$FM$ui$select_size
#> [1] 10
#> 
#> $FM_UD$yaml$FM$ui$color_green
#> [1] "#00BB8A"
#> 
#> $FM_UD$yaml$FM$ui$color_red
#> [1] "#FF475E"
#> 
#> $FM_UD$yaml$FM$ui$color_blue
#> [1] "#0088FF"
#> 
#> $FM_UD$yaml$FM$ui$color_purple
#> [1] "#bd2cf4"
#> 
#> 
#> $FM_UD$yaml$FM$data_meta
#> $FM_UD$yaml$FM$data_meta$data_header
#> [1] "<span style='color:===COLOR==='><b>===NAME===</b><br/><font size='-3'>===LABEL===</font></span>"
#> 
#> $FM_UD$yaml$FM$data_meta$subtext
#> [1] "===LABEL===: ===RANGE==="
#> 
#> $FM_UD$yaml$FM$data_meta$many_sep
#> [1] ",⋅⋅⋅,"
#> 
#> $FM_UD$yaml$FM$data_meta$data_types
#> $FM_UD$yaml$FM$data_meta$data_types$character
#> $FM_UD$yaml$FM$data_meta$data_types$character$color
#> [1] "#DD4B39"
#> 
#> $FM_UD$yaml$FM$data_meta$data_types$character$label
#> [1] "text"
#> 
#> 
#> $FM_UD$yaml$FM$data_meta$data_types$double
#> $FM_UD$yaml$FM$data_meta$data_types$double$color
#> [1] "#3C8DBC"
#> 
#> $FM_UD$yaml$FM$data_meta$data_types$double$label
#> [1] "num"
#> 
#> 
#> $FM_UD$yaml$FM$data_meta$data_types$integer
#> $FM_UD$yaml$FM$data_meta$data_types$integer$color
#> [1] "#3C8DBC"
#> 
#> $FM_UD$yaml$FM$data_meta$data_types$integer$label
#> [1] "num"
#> 
#> 
#> $FM_UD$yaml$FM$data_meta$data_types$other
#> $FM_UD$yaml$FM$data_meta$data_types$other$color
#> [1] "black"
#> 
#> $FM_UD$yaml$FM$data_meta$data_types$other$label
#> [1] "other"
#> 
#> 
#> 
#> 
#> $FM_UD$yaml$FM$labels
#> $FM_UD$yaml$FM$labels$default_ds
#> [1] "Original data set"
#> 
#> 
#> $FM_UD$yaml$FM$user_files
#> $FM_UD$yaml$FM$user_files$use_tmpdir
#> [1] TRUE
#> 
#> 
#> $FM_UD$yaml$FM$logging
#> $FM_UD$yaml$FM$logging$enabled
#> [1] TRUE
#> 
#> $FM_UD$yaml$FM$logging$timestamp
#> [1] TRUE
#> 
#> $FM_UD$yaml$FM$logging$timestamp_fmt
#> [1] "%Y-%m-%d %H:%M:%S"
#> 
#> $FM_UD$yaml$FM$logging$log_file
#> [1] "formods_log.txt"
#> 
#> $FM_UD$yaml$FM$logging$console
#> [1] TRUE
#> 
#> 
#> 
#> 
#> $FM_UD$MC
#> $FM_UD$MC$compact
#> $FM_UD$MC$compact$code
#> [1] FALSE
#> 
#> $FM_UD$MC$compact$preview
#> [1] TRUE
#> 
#> 
#> $FM_UD$MC$reporting
#> $FM_UD$MC$reporting$enabled
#> [1] FALSE
#> 
#> $FM_UD$MC$reporting$priority
#> [1] 1
#> 
#> 
#> $FM_UD$MC$labels
#> $FM_UD$MC$labels$default_ds
#> [1] "Original data set"
#> 
#> $FM_UD$MC$labels$upload_button
#> [1] "Select file"
#> 
#> $FM_UD$MC$labels$tab_main
#> [1] "Upload file"
#> 
#> $FM_UD$MC$labels$tab_code
#> [1] "Code"
#> 
#> $FM_UD$MC$labels$tab_preview
#> [1] "Data preview"
#> 
#> $FM_UD$MC$labels$switch_clean
#> [1] "Clean column names on upload"
#> 
#> $FM_UD$MC$labels$msg_bad_extension
#> [1] "Incorrect file extension (===EXT===). Unable to load file  ===FILE===.\nOnly the following extesions are allowed: ===ALLOWEDEXT===."
#> 
#> 
#> $FM_UD$MC$tooltips
#> $FM_UD$MC$tooltips$include
#> [1] TRUE
#> 
#> $FM_UD$MC$tooltips$show_code
#> [1] "Show data reading code"
#> 
#> 
#> $FM_UD$MC$formatting
#> $FM_UD$MC$formatting$preview
#> $FM_UD$MC$formatting$preview$width
#> [1] 800
#> 
#> $FM_UD$MC$formatting$preview$height
#> [1] 500
#> 
#> 
#> $FM_UD$MC$formatting$code
#> $FM_UD$MC$formatting$code$width
#> [1] 500
#> 
#> $FM_UD$MC$formatting$code$height
#> [1] 200
#> 
#> 
#> $FM_UD$MC$formatting$switch_clean
#> $FM_UD$MC$formatting$switch_clean$tooltip
#> [1] "Strange characters in column names can cause problems. When switched on, this will clean up the column headers and fix those that might break things."
#> 
#> $FM_UD$MC$formatting$switch_clean$tooltip_position
#> [1] "bottom"
#> 
#> 
#> 
#> $FM_UD$MC$allowed_extensions
#> [1] "csv"  "tsv"  "xls"  "xlsx"
#> 
#> $FM_UD$MC$code
#> $FM_UD$MC$code$packages
#> [1] "readxl"  "readr"   "janitor"
#> 
#> $FM_UD$MC$code$readOnly
#> [1] TRUE
#> 
#> $FM_UD$MC$code$mode
#> [1] "r"
#> 
#> $FM_UD$MC$code$preamble
#> [1] "# Loading data ------------------------------------------------------------"
#> 
#> 
#> $FM_UD$MC$ds_object_name
#> [1] "myDS"
#> 
#> $FM_UD$MC$clean_data
#> $FM_UD$MC$clean_data$enabled
#> [1] TRUE
#> 
#> $FM_UD$MC$clean_data$default
#> [1] TRUE
#> 
#> $FM_UD$MC$clean_data$code
#> [1] "# Make sure you put whatever packages you use here in the packages section\n# above.\n#\n# contents - data frame containing the loaded dataset.\n# code     - code used to load the dataset you need to append any cleaning\n#            code you generate  here.\n# object_name - Name of the dataset object used in generated code.\nif(system.file(package=\"janitor\") != \"\"){\n  contents = janitor::clean_names(contents, case=\"none\")\n  code = paste0(code, '\\n', object_name, ' = janitor::clean_names(', object_name,', case=\"none\")')\n}"
#> 
#> 
#> 
#> $FM_UD$UD
#> $FM_UD$UD$isgood
#> [1] TRUE
#> 
#> $FM_UD$UD$clean
#> [1] TRUE
#> 
#> $FM_UD$UD$load_msg
#> <em>File loaded.</em>
#> 
#> $FM_UD$UD$data_file_local
#> [1] "/var/folders/l9/6pm7xq5j1hn6l00zrs22j6mc0000gn/T//RtmpX58efW/non_shiny/FM/TEST_DATA.xlsx"
#> 
#> $FM_UD$UD$data_file_ext
#> [1] "xlsx"
#> 
#> $FM_UD$UD$data_file
#> [1] "TEST_DATA.xlsx"
#> 
#> $FM_UD$UD$sheet
#> NULL
#> 
#> $FM_UD$UD$sheets
#> [1] "DATA" "DDT" 
#> 
#> $FM_UD$UD$code
#> [1] "myDS = readxl::read_excel(path=\"TEST_DATA.xlsx\", sheet=\"DATA\")\nmyDS = janitor::clean_names(myDS, case=\"none\")"
#> 
#> $FM_UD$UD$object_name
#> [1] "myDS"
#> 
#> $FM_UD$UD$checksum
#> [1] "897d952fecbc804999396a96f9df4b20"
#> 
#> $FM_UD$UD$contents
#> # A tibble: 10,680 × 33
#>       ID TIME_DY TIME_HR NTIME_DY NTIME_HR  TIME     AMT    DV RECDESC     DOSE
#>    <dbl>   <dbl>   <dbl>    <dbl>    <dbl> <dbl>   <dbl> <dbl> <chr>      <dbl>
#>  1     1       0       0        0        0     0 3000000    0  dose     3000000
#>  2     1       0       0        0        0     0       0 1250  BM_ng_ml 3000000
#>  3     1       0       0        0        0     0       0    0  C_ng_ml  3000000
#>  4     1       1      24        1       24    24       0 1647  BM_ng_ml 3000000
#>  5     1       1      24        1       24    24       0  690. C_ng_ml  3000000
#>  6     1       2      48        2       48    48       0 1947  BM_ng_ml 3000000
#>  7     1       2      48        2       48    48       0  588. C_ng_ml  3000000
#>  8     1       3      72        3       72    72       0 2170  BM_ng_ml 3000000
#>  9     1       3      72        3       72    72       0  506. C_ng_ml  3000000
#> 10     1       4      96        4       96    96       0 2332  BM_ng_ml 3000000
#> # ℹ 10,670 more rows
#> # ℹ 23 more variables: DOSE_STR <chr>, Cohort <chr>, ROUTE <chr>, WT <dbl>,
#> #   SUBTYPE <chr>, SEX <chr>, F1 <dbl>, ka <dbl>, CL <dbl>, Vc <dbl>, Vp <dbl>,
#> #   Q <dbl>, BM_IC <dbl>, kdeg_BM <dbl>, Emax <dbl>, EC50 <dbl>, CMT <chr>,
#> #   DUR <dbl>, EVID <dbl>, NDose <chr>, DOSE_NUM <dbl>, SUBTYPE_ID <dbl>,
#> #   SEX_ID <dbl>
#> 
#> 
#> $FM_UD$MOD_TYPE
#> [1] "UD"
#> 
#> $FM_UD$id
#> [1] "UD"
#> 
#> $FM_UD$FM_yaml_file
#> [1] "/private/var/folders/l9/6pm7xq5j1hn6l00zrs22j6mc0000gn/T/Rtmpxo3NAc/temp_libpathd88766845d8d/formods/templates/formods.yaml"
#> 
#> $FM_UD$MOD_yaml_file
#> [1] "/private/var/folders/l9/6pm7xq5j1hn6l00zrs22j6mc0000gn/T/Rtmpxo3NAc/temp_libpathd88766845d8d/formods/templates/UD.yaml"
#> 
#> $FM_UD$shiny_token
#> [1] "non_shiny"
#> 
#>