diff --git a/NAMESPACE b/NAMESPACE index d03d0c3..c484382 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -74,6 +74,7 @@ export(dwrs_builder) export(fers_builder) export(fetch_hold) export(fetch_package_version) +export(formods_check) export(has_changed) export(has_updated) export(icon_link) diff --git a/R/formods.R b/R/formods.R index e444d3d..e30749b 100644 --- a/R/formods.R +++ b/R/formods.R @@ -16,27 +16,86 @@ #'@importFrom writexl write_xlsx .onLoad <- function(libname, pkgname){ + #------------------------------------ + # If all the suggested packages are found this will be true: + suggested_found = TRUE + packageStartupMessage("Loading formods") + + fcres = formods_check(verbose = FALSE) + if(!fcres[["all_found"]]){ + packageStartupMessage("Missing suggested packages") + for(pkg in fcres[["missing_pkgs"]]){ + packageStartupMessage(paste0(" - ",pkg)) + } + } +} + +#'@export +#'@title Checks 'formods' Dependencies +#'@description Looks at the suggests and 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 datasets +#'available. +#'@param verbose Logical indicating if messages should be displayed +#'@return List with the following elements: +#' \itemize{ +#' \item{all_found:} Boolean indicating if all packages were found +#' \item{found_pkgs:} Character vector of found packages +#' \item{missing_pkgs:} Character vector of missing packages +#'} +#'@examples +#' fcres = formods_check() +formods_check <- function(verbose=TRUE){ + #------------------------------------ # Checking for rxpackages # If all the suggested packages are found this will be true: suggested_found = TRUE -# mr = FM_message("Loading formods", entry_type="h1") -# mr = FM_message("Checking for suggested packages", entry_type="h2") - - pkgs = c( - "clipr", "devtools", "DT", - "flextable", "ggpubr", "gtools", - "here", "janitor", "plotly", - "prompter", "shinybusy", "shinydashboard") - for(pkg in pkgs){ - if(!requireNamespace(pkg, quietly=TRUE)){ -# mr = FM_message(paste0("missing ", pkg), entry_type="danger") - } else { -# mr = FM_message(paste0("found ", pkg), entry_type="success") + if(verbose){ + mr = FM_message("Checking formods for suggested packages", entry_type="h1") + } + + pkgs = c( + "clipr", + "covr", + "devtools", + "DT", + "flextable", + "ggpubr", + "gtools", + "here", + "janitor", + "knitr", + "plotly", + "prompter", + "rmarkdown", + "shinybusy", + "shinydashboard", + "testthat", + "utils") + + pkg_found = c() + pkg_missing = c() + for(pkg in pkgs){ + if(!requireNamespace(pkg, quietly=TRUE)){ + if(verbose){ + mr = FM_message(paste0("missing ", pkg), entry_type="danger") + } + pkg_missing = c(pkg_missing, pkg) + suggested_found = FALSE + } else { + if(verbose){ + mr = FM_message(paste0("found ", pkg), entry_type="success") } + pkg_found = c(pkg_found , pkg) } -} + } + res = list( + all_found = suggested_found, + found_pkgs = pkg_found, + missing_pkgs = pkg_missing + ) +res} diff --git a/_pkgdown.yml b/_pkgdown.yml index 677864d..b4b5eaf 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -14,6 +14,7 @@ reference: - starts_with("FM_") - fetch_hold - fetch_package_version + - formods_check - has_changed - has_updated - icon_link diff --git a/docs/articles/included_modules.html b/docs/articles/included_modules.html index c50e85d..ac76a4e 100644 --- a/docs/articles/included_modules.html +++ b/docs/articles/included_modules.html @@ -131,38 +131,38 @@

Avialable modules - - + +
- - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + +

Module

SN

htmlOutput

Other Outputs

Module

SN

htmlOutput

Other Outputs

App State Mangement

ASM

ui_asm_save_name, ui_asm_save_button, ui_asm_load_state

ui_asm_msg, ui_asm_ace_code

App State Mangement

ASM

ui_asm_save_name, ui_asm_save_button, ui_asm_load_state

ui_asm_msg, ui_asm_ace_code

Upload Data

UD

ui_ud_load_data, ui_ud_select_sheets, ui_ud_text_load_result, ui_ud_data_preview

ui_ud_ace_code

Upload Data

UD

ui_ud_load_data, ui_ud_select_sheets, ui_ud_text_load_result, ui_ud_data_preview

ui_ud_ace_code

Data Wrangling

DW

ui_dw_views, ui_dw_key, ui_dw_new_view, ui_dw_save_view, ui_dw_del_view, ui_dw_copy_view, ui_dw_add_element_button, ui_dw_select, ui_dw_new_element_row

hot_dw_elements, hot_data_preview, ui_dw_msg, ui_dw_code

Data Wrangling

DW

ui_dw_views, ui_dw_key, ui_dw_new_view, ui_dw_save_view, ui_dw_del_view, ui_dw_copy_view, ui_dw_add_element_button, ui_dw_select, ui_dw_new_element_row

hot_dw_elements, hot_data_preview, ui_dw_msg, ui_dw_code

Figure Generation

FG

ui_fg_curr_views, ui_fg_curr_figs, ui_fg_new_fig, ui_fg_save_fig, ui_fg_del_fig, ui_fg_copy_fig, ui_fg_fig_name, ui_fg_fig_notes, ui_fg_add_element_button, ui_fg_select, ui_fg_new_element_row, ui_fg_msg, ui_fg_slider_page

hot_fg_elements, ui_fg_preview_ggplot, ui_fg_msg, ui_fg_code

Figure Generation

FG

ui_fg_curr_views, ui_fg_curr_figs, ui_fg_new_fig, ui_fg_save_fig, ui_fg_del_fig, ui_fg_copy_fig, ui_fg_fig_name, ui_fg_fig_notes, ui_fg_add_element_button, ui_fg_select, ui_fg_new_element_row, ui_fg_msg, ui_fg_slider_page

hot_fg_elements, ui_fg_preview_ggplot, ui_fg_msg, ui_fg_code

diff --git a/docs/articles/making_modules.html b/docs/articles/making_modules.html index fa93417..fb3fe43 100644 --- a/docs/articles/making_modules.html +++ b/docs/articles/making_modules.html @@ -438,6 +438,7 @@

Helper functions in formods
 library(formods)
+#> Loading formods
 # This creates the state and session objects
 sess_res = UD_test_mksession(session=list())
 #> → UD: including file
@@ -541,8 +542,8 @@ 

Dataframe formatting information colHeaders = as.vector(unlist(hfmt[["col_heads"]])), rowHeaders = NULL )

-
-

To add subtext to a selection widget in Shiny you need to use the +

+

To add subtext to a selection widget in Shiny you need to use the shinyWidgets package.

 sel_subtext = as.vector(unlist( hfmt[["col_subtext"]]))
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index f74bcb9..b70735d 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -4,5 +4,5 @@ pkgdown_sha: ~
 articles:
   included_modules: included_modules.html
   making_modules: making_modules.html
-last_built: 2024-03-13T02:44Z
+last_built: 2024-03-15T02:06Z
 
diff --git a/docs/reference/ASM_fetch_code.html b/docs/reference/ASM_fetch_code.html
index b6e2e4e..38120e8 100644
--- a/docs/reference/ASM_fetch_code.html
+++ b/docs/reference/ASM_fetch_code.html
@@ -90,9 +90,72 @@ 

Value

Examples

# Creating a state object for testing
 sess_res = ASM_test_mksession(session=list(), full_session=FALSE)
-#> Error in session$userData: object of type 'builtin' is not subsettable
+#> → 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
+#> → DW: including file
+#> → DW:   source: file.path(system.file(package="onbrand"), "templates", "report.docx")
+#> → DW:   dest:   file.path("config","report.docx")
+#> → DW: including file
+#> → DW:   source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
+#> → DW:   dest:   file.path("config","report.pptx")
+#> → DW: including file
+#> → DW:   source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
+#> → DW:   dest:   file.path("config","report.yaml")
+#> → DW: State initialized
+#> → DW: module checksum updated:5b0f0b05ee3ac7336a74c564bb6efdad
+#> → DW: module checksum updated:65801ab4b3c645aabf7edf91fc2f0d2c
+#> → DW: module checksum updated:7fb2dd3b16b1780c4c24f64d658dd7c7
+#> → DW: module checksum updated:5ab04ea00be44c0040695a4ed6243c90
+#> → DW: module checksum updated:960db107cfe9db93578f79f0ae6283e2
+#> → DW: module checksum updated:f0b5d122dcb04f207cba233253b61c4b
+#> → DW: module checksum updated:189ed77a84bd9fcdd7b26abff8bea34a
+#> → DW: module checksum updated:669ec77d50652669cd3fcfd949469b37
+#> → DW: module checksum updated:dd6cafa0be3b6b195d230a11e9f07f9f
+#> → DW: module checksum updated:5c2022c376ca8f56b839347156559890
+#> → DW: module checksum updated:43640500a04674debd8e2399056c384a
+#> → DW: module checksum updated:f81c45ac1ef4e7b43153d8c8eaf7aed6
+#> → DW: module checksum updated:207cde891d98e20c4afbb7fb5fb0aba2
+#> → DW: module checksum updated:0a673e81c01cbbf33533dd65d6baf9e3
+#> → DW: module checksum updated:af3f3aefd0115ed9dfdd4d6ef9d5182f
+#> → DW: module checksum updated:b0ccaee21e859322df0bf79d00c4b347
+#> → DW: module checksum updated:2d3d6e9e38be6dea813b2d4d679e34b5
+#> → DW: module checksum updated:2b60dd49b48a4e65200dc7241ad270e3
+#> → DW: module checksum updated:3c92f397181a4fcdbdf2bd7dd7425e77
+#> → DW: module checksum updated:92b81d7573def603649370b87c123b55
+#> → DW: module checksum updated:9210264aabc0339e832b0c6bcfda32af
+#> → DW: module checksum updated:fe62fde1e7e738a1a35c479de9d5007b
+#> → DW: module checksum updated:ff3edcd4c1e58c96ea2707361916ffbc
+#> → DW: module checksum updated:b6cdfcef0432c5d9b1fa2bd46122ffa2
+#> → DW: module checksum updated:4fa4283f1fd8fd6cf6e6e7df0669723a
+#> → DW: module checksum updated:cf3e139cef554b2d09dca619ee6aff41
+#> → DW: module checksum updated:a9154d91a9e4b5d21f9585a6f68dd083
+#> → DW: module checksum updated:4b5c6ad66658ddfa92d10ae1b0b7afa8
+#> → DW: module checksum updated:591ac875a490b66a1fa7f4e7d4ba1c62
+#> → DW: module checksum updated:afa3ca309cc3e6a48f542f4e8eadd54a
+#> → DW: module checksum updated:5c918dd4f53a4f1e56115abb09c4f332
+#> → DW: module checksum updated:159ddf8c8cd26b178dfda5434bbecfa1
+#> → DW: module checksum updated:8bb3c97e700998f2f73353189bd07831
+#> → DW: module checksum updated:a1eceffec3ff7d9f9961683b3d07088b
+#> → ASM: including file
+#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.docx")
+#> → ASM:   dest:   file.path("config","report.docx")
+#> → ASM: including file
+#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
+#> → ASM:   dest:   file.path("config","report.pptx")
+#> → ASM: including file
+#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
+#> → ASM:   dest:   file.path("config","report.yaml")
+#> → ASM: State initialized
 state = sess_res$state
-#> Error in eval(expr, envir, enclos): object 'sess_res' not found
 code = ASM_fetch_code(state)
 
diff --git a/docs/reference/ASM_fetch_dlfn.html b/docs/reference/ASM_fetch_dlfn.html index df09311..47609de 100644 --- a/docs/reference/ASM_fetch_dlfn.html +++ b/docs/reference/ASM_fetch_dlfn.html @@ -97,13 +97,75 @@

Value

Examples

# Creating a state object for testing
 sess_res = ASM_test_mksession(session=list(), full_session=FALSE)
-#> Error in session$userData: object of type 'builtin' is not subsettable
+#> → 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
+#> → DW: including file
+#> → DW:   source: file.path(system.file(package="onbrand"), "templates", "report.docx")
+#> → DW:   dest:   file.path("config","report.docx")
+#> → DW: including file
+#> → DW:   source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
+#> → DW:   dest:   file.path("config","report.pptx")
+#> → DW: including file
+#> → DW:   source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
+#> → DW:   dest:   file.path("config","report.yaml")
+#> → DW: State initialized
+#> → DW: module checksum updated:5b0f0b05ee3ac7336a74c564bb6efdad
+#> → DW: module checksum updated:65801ab4b3c645aabf7edf91fc2f0d2c
+#> → DW: module checksum updated:7fb2dd3b16b1780c4c24f64d658dd7c7
+#> → DW: module checksum updated:5ab04ea00be44c0040695a4ed6243c90
+#> → DW: module checksum updated:960db107cfe9db93578f79f0ae6283e2
+#> → DW: module checksum updated:f0b5d122dcb04f207cba233253b61c4b
+#> → DW: module checksum updated:189ed77a84bd9fcdd7b26abff8bea34a
+#> → DW: module checksum updated:669ec77d50652669cd3fcfd949469b37
+#> → DW: module checksum updated:dd6cafa0be3b6b195d230a11e9f07f9f
+#> → DW: module checksum updated:5c2022c376ca8f56b839347156559890
+#> → DW: module checksum updated:43640500a04674debd8e2399056c384a
+#> → DW: module checksum updated:f81c45ac1ef4e7b43153d8c8eaf7aed6
+#> → DW: module checksum updated:207cde891d98e20c4afbb7fb5fb0aba2
+#> → DW: module checksum updated:0a673e81c01cbbf33533dd65d6baf9e3
+#> → DW: module checksum updated:af3f3aefd0115ed9dfdd4d6ef9d5182f
+#> → DW: module checksum updated:b0ccaee21e859322df0bf79d00c4b347
+#> → DW: module checksum updated:2d3d6e9e38be6dea813b2d4d679e34b5
+#> → DW: module checksum updated:2b60dd49b48a4e65200dc7241ad270e3
+#> → DW: module checksum updated:3c92f397181a4fcdbdf2bd7dd7425e77
+#> → DW: module checksum updated:92b81d7573def603649370b87c123b55
+#> → DW: module checksum updated:9210264aabc0339e832b0c6bcfda32af
+#> → DW: module checksum updated:fe62fde1e7e738a1a35c479de9d5007b
+#> → DW: module checksum updated:ff3edcd4c1e58c96ea2707361916ffbc
+#> → DW: module checksum updated:b6cdfcef0432c5d9b1fa2bd46122ffa2
+#> → DW: module checksum updated:4fa4283f1fd8fd6cf6e6e7df0669723a
+#> → DW: module checksum updated:cf3e139cef554b2d09dca619ee6aff41
+#> → DW: module checksum updated:a9154d91a9e4b5d21f9585a6f68dd083
+#> → DW: module checksum updated:4b5c6ad66658ddfa92d10ae1b0b7afa8
+#> → DW: module checksum updated:591ac875a490b66a1fa7f4e7d4ba1c62
+#> → DW: module checksum updated:afa3ca309cc3e6a48f542f4e8eadd54a
+#> → DW: module checksum updated:5c918dd4f53a4f1e56115abb09c4f332
+#> → DW: module checksum updated:159ddf8c8cd26b178dfda5434bbecfa1
+#> → DW: module checksum updated:8bb3c97e700998f2f73353189bd07831
+#> → DW: module checksum updated:a1eceffec3ff7d9f9961683b3d07088b
+#> → ASM: including file
+#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.docx")
+#> → ASM:   dest:   file.path("config","report.docx")
+#> → ASM: including file
+#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
+#> → ASM:   dest:   file.path("config","report.pptx")
+#> → ASM: including file
+#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
+#> → ASM:   dest:   file.path("config","report.yaml")
+#> → ASM: State initialized
 state = sess_res$state
-#> Error in eval(expr, envir, enclos): object 'sess_res' not found
 dlfn = ASM_fetch_dlfn(state)
-#> Error in ASM_fetch_dlfn(state): object 'state' not found
 dlfn
-#> Error in eval(expr, envir, enclos): object 'dlfn' not found
+#> [1] "Save Analysis.zip"