From 83fac94266f8a42c16ce7b4b2376b195c47efb01 Mon Sep 17 00:00:00 2001 From: Andreas Gammelgaard Damsbo Date: Thu, 16 Jan 2025 12:23:39 +0100 Subject: [PATCH] external docs linked and updated --- R/theme.R | 9 +-- README.md | 14 +++- _pkgdown.yml | 9 ++- inst/apps/data_analysis_modules/app.R | 56 ++++++++++----- inst/apps/data_analysis_modules/ui.R | 29 +++++--- inst/apps/data_analysis_modules/www/docs.html | 69 ------------------- inst/apps/data_analysis_modules/www/docs.qmd | 45 ------------ .../apps/data_analysis_modules/www/intro.html | 22 ++++-- inst/apps/data_analysis_modules/www/intro.md | 4 ++ 9 files changed, 103 insertions(+), 154 deletions(-) delete mode 100644 inst/apps/data_analysis_modules/www/docs.html delete mode 100644 inst/apps/data_analysis_modules/www/docs.qmd diff --git a/R/theme.R b/R/theme.R index ffc3c50..d0533f8 100644 --- a/R/theme.R +++ b/R/theme.R @@ -8,20 +8,21 @@ custom_theme <- function(..., version = 5, primary = "#1E4A8F", secondary = "#FF6F61", + bootswatch = "united", + base_font = bslib::font_google("Montserrat"), + heading_font = bslib::font_google("Public Sans",wght = "700"), + code_font = bslib::font_google("Open Sans") # success = "#1E4A8F", # info = , # warning = , # danger = , # fg = "#000", # bg="#fff", - bootswatch = "united", - base_font = bslib::font_google("Montserrat"), # base_font = bslib::font_google("Alice"), # heading_font = bslib::font_google("Jost", wght = "800"), # heading_font = bslib::font_google("Noto Serif"), # heading_font = bslib::font_google("Alice"), - heading_font = bslib::font_google("Public Sans",wght = "700"), - code_font = bslib::font_google("Open Sans")){ + ){ bslib::bs_theme( ..., version = version, diff --git a/README.md b/README.md index ff2392a..867781f 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ [![freesearcheR](https://img.shields.io/badge/Shiny-shinyapps.io-blue?style=flat&labelColor=white&logo=RStudio&logoColor=blue)](https://agdamsbo.shinyapps.io/freesearcheR/) -This package is the backbone of the free and open browser based data exploration and analysis tool with publication ready output. +This package is the backbone of the ***freesearcheR***, a free and open-source browser based data exploration and analysis tool for clinicians and researchers with publication ready output. -This package and the ***freesearcheR***-tool is part of a large project to democratize health data analysis and removing barriers for clinicians to engage in health research. +This package and the ***freesearcheR***-tool is part of a larger initiative to democratize health data analysis and remove barriers for clinicians to engage in health research. the ***freesearcheR***-tool is online and accessible here: [link to the app freely hosted on shinyapps.io](https://agdamsbo.shinyapps.io/freesearcheR/). All feedback is welcome and can be shared as a GitHub issue. @@ -17,6 +17,10 @@ Initiatives for funding continued development of the tool and surrounding initia ## Roadmap +The current state of the app is considered experimental, and a lot of things are still changing. It is, however, in a usable state, with basic functions available to the user. + +Below are some (the actual list is quite long and growing) of the planned features and improvements: + - [ ] Stratified analyses - Additional study designs: @@ -32,6 +36,12 @@ Initiatives for funding continued development of the tool and surrounding initia - [x] Add histograms for data distribution. 2025-01-16 - [x] Option to edit labels. 2025-01-16 + +- More output controls + + - [ ] Theming output tables + + - [ ] Select analyses to include in report - [ ] Plot regression analyses results diff --git a/_pkgdown.yml b/_pkgdown.yml index 12b9f32..cdf5292 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,11 @@ url: https://agdamsbo.github.io/freesearcheR/ template: - bootstrap: 5 + bslib: + version: 5 + primary: "#1E4A8F" + secondary: "#FF6F61" + bootswatch: "united" + base_font: bslib::font_google("Montserrat") + heading_font: bslib::font_google("Public Sans",wght: "700") + code_font: bslib::font_google("Open Sans") diff --git a/inst/apps/data_analysis_modules/app.R b/inst/apps/data_analysis_modules/app.R index 8b459dc..2142587 100644 --- a/inst/apps/data_analysis_modules/app.R +++ b/inst/apps/data_analysis_modules/app.R @@ -123,7 +123,7 @@ library(shiny) # structure(match(splitter, names(labs)), levels = labs, class = "factor") # } -#' Title +#' Extended cutting function #' #' @param x an object inheriting from class "hms" #' @param ... passed on @@ -808,7 +808,7 @@ add_sparkline <- function(grid, column = "vals", color.main = "#2a8484", color.s #' #' @param data vector #' -#' @returns +#' @returns logical #' @export #' #' @examples @@ -915,6 +915,10 @@ create_overview_datagrid <- function(data) { #' @export #' #' @examples +#' mtcars |> +#' overview_vars() |> +#' toastui::datagrid() |> +#' add_class_icon() add_class_icon <- function(grid, column = "class") { out <- toastui::grid_format( grid = grid, @@ -2180,20 +2184,21 @@ custom_theme <- function(..., version = 5, primary = "#1E4A8F", secondary = "#FF6F61", + bootswatch = "united", + base_font = bslib::font_google("Montserrat"), + heading_font = bslib::font_google("Public Sans",wght = "700"), + code_font = bslib::font_google("Open Sans") # success = "#1E4A8F", # info = , # warning = , # danger = , # fg = "#000", # bg="#fff", - bootswatch = "united", - base_font = bslib::font_google("Montserrat"), # base_font = bslib::font_google("Alice"), # heading_font = bslib::font_google("Jost", wght = "800"), # heading_font = bslib::font_google("Noto Serif"), # heading_font = bslib::font_google("Alice"), - heading_font = bslib::font_google("Public Sans",wght = "700"), - code_font = bslib::font_google("Open Sans")){ + ){ bslib::bs_theme( ..., version = version, @@ -2599,8 +2604,14 @@ add_var_toset <- function(data, var_name, default = "") { data[, datanames] } -#' @importFrom toastui datagrid grid_columns grid_format grid_style_column -#' grid_style_column grid_editor grid_editor_opts grid_selection_row +#' Modified from the datamods pacakge +#' +#' @param data data +#' +#' @param height height +#' @param selectionId selectionId +#' @param buttonId buttonId +#' #' @examples #' mtcars |> #' summary_vars() |> @@ -3018,9 +3029,10 @@ ui_elements <- list( shiny::column( width = 9, shiny::tags$p( - "Below is a short summary table of the provided data. + "Below is a short summary table of the provided data. On the right hand side you have the option to create filters. - At the bottom you'll find a raw overview of the original vs the modified data.") + At the bottom you'll find a raw overview of the original vs the modified data." + ) ) ), fluidRow( @@ -3121,8 +3133,8 @@ ui_elements <- list( title = "Browser", tags$h3("Browse the provided data"), shiny::tags$p( - "Below is a data table with all the modified data provided to browse and understand data." - ), + "Below is a data table with all the modified data provided to browse and understand data." + ), shinyWidgets::html_dependency_winbox(), # fluidRow( # column( @@ -3306,12 +3318,21 @@ ui_elements <- list( ######### Documentation panel ######### ############################################################################## - "docs" = bslib::nav_panel( - title = "Documentation", - # shiny::tags$iframe("www/docs.html", height=600, width=535), - shiny::htmlOutput("docs_file"), - shiny::br() + "docs" = bslib::nav_item( + # shiny::img(shiny::icon("book")), + shiny::tags$a( + href = "https://agdamsbo.github.io/freesearcheR/", + "Docs (external)", + target = "_blank", + rel = "noopener noreferrer" ) + ) + # bslib::nav_panel( + # title = "Documentation", + # # shiny::tags$iframe("www/docs.html", height=600, width=535), + # shiny::htmlOutput("docs_file"), + # shiny::br() + # ) ) # Initial attempt at creating light and dark versions @@ -3344,6 +3365,7 @@ ui <- bslib::page_fixed( ui_elements$import, ui_elements$overview, ui_elements$analyze, + bslib::nav_spacer(), ui_elements$docs, # bslib::nav_spacer(), # bslib::nav_item(shinyWidgets::circleButton(inputId = "mode", icon = icon("moon"),status = "primary")), diff --git a/inst/apps/data_analysis_modules/ui.R b/inst/apps/data_analysis_modules/ui.R index 473b809..dd88d4c 100644 --- a/inst/apps/data_analysis_modules/ui.R +++ b/inst/apps/data_analysis_modules/ui.R @@ -93,9 +93,10 @@ ui_elements <- list( shiny::column( width = 9, shiny::tags$p( - "Below is a short summary table of the provided data. + "Below is a short summary table of the provided data. On the right hand side you have the option to create filters. - At the bottom you'll find a raw overview of the original vs the modified data.") + At the bottom you'll find a raw overview of the original vs the modified data." + ) ) ), fluidRow( @@ -196,8 +197,8 @@ ui_elements <- list( title = "Browser", tags$h3("Browse the provided data"), shiny::tags$p( - "Below is a data table with all the modified data provided to browse and understand data." - ), + "Below is a data table with all the modified data provided to browse and understand data." + ), shinyWidgets::html_dependency_winbox(), # fluidRow( # column( @@ -381,12 +382,21 @@ ui_elements <- list( ######### Documentation panel ######### ############################################################################## - "docs" = bslib::nav_panel( - title = "Documentation", - # shiny::tags$iframe("www/docs.html", height=600, width=535), - shiny::htmlOutput("docs_file"), - shiny::br() + "docs" = bslib::nav_item( + # shiny::img(shiny::icon("book")), + shiny::tags$a( + href = "https://agdamsbo.github.io/freesearcheR/", + "Docs (external)", + target = "_blank", + rel = "noopener noreferrer" ) + ) + # bslib::nav_panel( + # title = "Documentation", + # # shiny::tags$iframe("www/docs.html", height=600, width=535), + # shiny::htmlOutput("docs_file"), + # shiny::br() + # ) ) # Initial attempt at creating light and dark versions @@ -419,6 +429,7 @@ ui <- bslib::page_fixed( ui_elements$import, ui_elements$overview, ui_elements$analyze, + bslib::nav_spacer(), ui_elements$docs, # bslib::nav_spacer(), # bslib::nav_item(shinyWidgets::circleButton(inputId = "mode", icon = icon("moon"),status = "primary")), diff --git a/inst/apps/data_analysis_modules/www/docs.html b/inst/apps/data_analysis_modules/www/docs.html deleted file mode 100644 index 9c2ae4b..0000000 --- a/inst/apps/data_analysis_modules/www/docs.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - -freesearcheR platform documentation - - - - - - - - - - -
-

freesearcheR platform documentation

- -
- - -

Welcome!

-

So glad to see you here! Welcome to test this early concept of a platform to easily explore, manipulate and analyse clinical data.

-

Below will be a more detailed description of the included features and possibilities, as well as the planned and possible feature additions.

-

Contribute

-

Contributions are very welcome. If you find anything odd, or you think of features to add or remove, please share and report on the project page on GitHub.

-

Roadmap

- - - - - - - \ No newline at end of file diff --git a/inst/apps/data_analysis_modules/www/docs.qmd b/inst/apps/data_analysis_modules/www/docs.qmd deleted file mode 100644 index 58b5a30..0000000 --- a/inst/apps/data_analysis_modules/www/docs.qmd +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: "***freesearcheR*** platform documentation" -format: - html: - self-contained: true - minimal: true ---- - -# Welcome! - -So glad to see you here! Welcome to test this early concept of a platform to easily explore, manipulate and analyse clinical data. - -Below will be a more detailed description of the included features and possibilities, as well as the planned and possible feature additions. - -## Contribute - -Contributions are very welcome. If you find anything odd, or you think of features to add or remove, please [share and report on the project page on GitHub](https://github.com/agdamsbo/freesearcheR/issues). - -## Roadmap - -- [ ] Stratified analyses - -- Additional study designs: - - - [x] Cross-sectional data analyses - - - [ ] Longitudinal data analyses - - - [ ] Survival analysis - -- More detailed variable browser - - - [ ] Add histograms for data distribution - - - [ ] Option to edit variable labels for nicer tables - -- [ ] Plot regression analyses results - -- [x] Export modified data. 2025-01-09 - -- [ ] Include reproducible code for all steps - -- [x] ~~Modify factor levels~~ Factor level modification is possible through converting factors to numeric > cutting numeric with desired fixed values. 2024-12-12 - -- [x] More options for date/datetime/time grouping/factoring. Included weekday and month-only options. 2024-12-12 diff --git a/inst/apps/data_analysis_modules/www/intro.html b/inst/apps/data_analysis_modules/www/intro.html index cea20b0..3a1299b 100644 --- a/inst/apps/data_analysis_modules/www/intro.html +++ b/inst/apps/data_analysis_modules/www/intro.html @@ -354,18 +354,18 @@ display: none;

Welcome

-

This is the freesearchR web data analysis -tool. We intend the freesearchR to be a +

This is the freesearcheR web data analysis +tool. We intend the freesearcheR to be a powerful and free tool for easy data evaluation and analysis at the hands of the clinician.

By intention, this tool has been designed to be simple to use with a minimum of mandatory options to keep the workflow streamlined, while also including a few options to go even further.

-

There are four simple steps to go through:

+

There are four simple steps to go through (see corresponding tabs in +the top):

    -
  1. “Import -data” (a spreadsheet/file on your machine, direct export from a -REDCap server, or a local file provided with a package) to get +

  2. Import data (a spreadsheet/file on your machine, direct export +from a REDCap server, or a local file provided with a package) to get started.

  3. An optional step of data modification (change variable classes and creating categorical variables (factors) from numeric or @@ -379,8 +379,16 @@ compare variables)

  4. depending on specified outcome variable

  5. Evaluation of model assumptions

  6. -
  7. Export the the analyses results as for MS Word or LibreOffice.

  8. +
  9. Export the the analyses results for MS Word or LibreOffice as well as the data +with preserved metadata.

+

Have a look at the documentations page for further +project description. If you’re interested in the source code, then go +on, have a +look!

+

If you encounter anything strange or the app doesn’t act as expected. +Please report +on Github.

diff --git a/inst/apps/data_analysis_modules/www/intro.md b/inst/apps/data_analysis_modules/www/intro.md index 38c436e..9271b5c 100644 --- a/inst/apps/data_analysis_modules/www/intro.md +++ b/inst/apps/data_analysis_modules/www/intro.md @@ -19,3 +19,7 @@ There are four simple steps to go through (see corresponding tabs in the top): - Evaluation of model assumptions 4. Export the the analyses results for MS Word or [LibreOffice](https://www.libreoffice.org/) as well as the data with preserved metadata. + +Have a look at the [documentations page]() for further project description. If you're interested in the source code, then go on, [have a look](https://github.com/agdamsbo/freesearcheR)! + +If you encounter anything strange or the app doesn't act as expected. Please [report on Github](https://github.com/agdamsbo/freesearcheR/issues).