From a01f7157b5b831437f0e7db98b0931c650296295 Mon Sep 17 00:00:00 2001 From: Andreas Gammelgaard Damsbo Date: Thu, 19 Dec 2024 15:26:23 +0100 Subject: [PATCH] naming and dealing with a dependency issue. ready for first release --- .Rbuildignore | 3 +- CODE_OF_CONDUCT.md | 126 ++++ DESCRIPTION | 14 +- NAMESPACE | 10 +- R/cut-variable-dates.R | 2 + R/file-import-module.R | 244 ++++---- R/helpers.R | 33 +- R/redcap_read_shiny_module.R | 7 +- R/regression_model.R | 3 +- R/regression_table.R | 4 +- R/shiny_freesearcheR.R | 25 + R/shiny_webResearch.R | 27 - README.md | 58 +- webResearch.Rproj => freesearcheR.Rproj | 0 inst/apps/data_analysis/server.R | 19 +- inst/apps/data_analysis_modules/app.R | 348 ++++++----- inst/apps/data_analysis_modules/server.R | 54 +- inst/apps/data_analysis_modules/ui.R | 2 +- inst/apps/data_analysis_modules/www/docs.html | 6 +- inst/apps/data_analysis_modules/www/docs.md | 34 -- inst/apps/data_analysis_modules/www/docs.qmd | 6 +- inst/apps/teal_test/app.R | 4 +- man/file_export.Rd | 23 + man/is_any_class.Rd | 2 + man/m_datafileUI.Rd | 17 - man/regression_table.Rd | 2 +- man/shiny_freesearcheR.Rd | 23 + man/shiny_webResearch.Rd | 26 - renv.lock | 557 +----------------- renv/settings.json | 19 + 30 files changed, 668 insertions(+), 1030 deletions(-) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 R/shiny_freesearcheR.R delete mode 100644 R/shiny_webResearch.R rename webResearch.Rproj => freesearcheR.Rproj (100%) delete mode 100644 inst/apps/data_analysis_modules/www/docs.md create mode 100644 man/file_export.Rd delete mode 100644 man/m_datafileUI.Rd create mode 100644 man/shiny_freesearcheR.Rd delete mode 100644 man/shiny_webResearch.Rd create mode 100644 renv/settings.json diff --git a/.Rbuildignore b/.Rbuildignore index d5e036f..46c6340 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,9 +1,10 @@ ^renv$ ^renv\.lock$ -^webResearch\.Rproj$ +^freesearcheR\.Rproj$ ^\.Rproj\.user$ ^LICENSE\.md$ ^dev$ ^\.github$ ^inst/shiny-examples/casting/functions\.R$ ^functions\.R$ +^CODE_OF_CONDUCT\.md$ diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..87d533e --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,126 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at agdamsbo@clin.au.dk. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][https://github.com/mozilla/inclusion]. + +For answers to common questions about this code of conduct, see the FAQ at +. Translations are available at . + +[homepage]: https://www.contributor-covenant.org diff --git a/DESCRIPTION b/DESCRIPTION index ce559d0..c2d3250 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,10 +1,10 @@ -Package: webResearch +Package: freesearcheR Title: Browser Based Data Analysis Version: 24.12.1 Authors@R: person("Andreas Gammelgaard", "Damsbo", , "agdamsbo@clin.au.dk", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7559-1154")) -Description: Browser based basic data analysis and research output. +Description: Free and open source browser based data exploration and analysis with publication ready output. License: AGPL (>= 3) Encoding: UTF-8 Roxygen: list(markdown = TRUE) @@ -17,7 +17,6 @@ Imports: gtsummary, haven, here, - openxlsx2, quarto, readODS, readr, @@ -50,6 +49,9 @@ Imports: Suggests: styler, devtools, - rhub -URL: https://github.com/agdamsbo/webResearch -BugReports: https://github.com/agdamsbo/webResearch/issues + rhub, + usethis, + roxygen2, + pak +URL: https://github.com/agdamsbo/freesearcheR +BugReports: https://github.com/agdamsbo/freesearcheR/issues diff --git a/NAMESPACE b/NAMESPACE index aa086c2..800bc03 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -9,12 +9,12 @@ export(cut_variable_ui) export(default_format_arguments) export(default_parsing) export(factorize) +export(file_export) export(format_writer) export(getfun) export(index_embed) export(is_any_class) export(is_datetime) -export(m_datafileUI) export(m_redcap_readServer) export(m_redcap_readUI) export(modal_cut_variable) @@ -23,11 +23,17 @@ export(read_input) export(regression_model) export(regression_model_uv) export(regression_table) -export(shiny_webResearch) +export(shiny_freesearcheR) export(specify_qmd_format) export(tbl_merge) export(winbox_cut_variable) export(write_quarto) +importFrom(REDCapCAST,as_factor) +importFrom(REDCapCAST,numchar2fct) +importFrom(REDCapCAST,parse_data) +importFrom(REDCapCAST,read_redcap_tables) +importFrom(REDCapCAST,redcap_wider) +importFrom(REDCapCAST,suffix2label) importFrom(classInt,classIntervals) importFrom(graphics,abline) importFrom(graphics,axis) diff --git a/R/cut-variable-dates.R b/R/cut-variable-dates.R index f72f430..8851a94 100644 --- a/R/cut-variable-dates.R +++ b/R/cut-variable-dates.R @@ -206,9 +206,11 @@ cut.Date <- function(x,breaks,start.on.monday=TRUE,...){ #' @export #' #' @examples +#' \dontrun{ #' vapply(REDCapCAST::redcapcast_data, \(.x){ #' is_any_class(.x, c("hms", "Date", "POSIXct", "POSIXt")) #' }, logical(1)) +#' } is_any_class <- function(data, class.vec) { any(class(data) %in% class.vec) } diff --git a/R/file-import-module.R b/R/file-import-module.R index 8210fc8..6d6305d 100644 --- a/R/file-import-module.R +++ b/R/file-import-module.R @@ -1,125 +1,125 @@ -#' Shiny UI module to load a data file +#' #' Shiny UI module to load a data file +#' #' +#' #' @param id id +#' #' +#' #' @return shiny UI +#' #' @export +#' #' +#' m_datafileUI <- function(id) { +#' ns <- shiny::NS(id) +#' shiny::tagList( +#' shiny::fileInput( +#' inputId = ns("file"), +#' label = "Upload a file", +#' multiple = FALSE, +#' accept = c( +#' ".csv", +#' ".xlsx", +#' ".xls", +#' ".dta", +#' ".ods", +#' ".rds" +#' ) +#' ), +#' shiny::h4("Parameter specifications"), +#' shiny::helpText(shiny::em("Select the desired variables and press 'Submit'")), +#' shiny::uiOutput(ns("include_vars")), +#' DT::DTOutput(ns("data_input")), +#' shiny::actionButton(ns("submit"), "Submit") +#' ) +#' } #' -#' @param id id +#' m_datafileServer <- function(id, output.format = "df") { +#' shiny::moduleServer(id, function(input, output, session, ...) { +#' ns <- shiny::NS(id) +#' ds <- shiny::reactive({ +#' REDCapCAST::read_input(input$file$datapath) |> REDCapCAST::parse_data() +#' }) #' -#' @return shiny UI -#' @export +#' output$include_vars <- shiny::renderUI({ +#' shiny::req(input$file) +#' shiny::selectizeInput( +#' inputId = ns("include_vars"), +#' selected = NULL, +#' label = "Covariables to include", +#' choices = colnames(ds()), +#' multiple = TRUE +#' ) +#' }) #' -m_datafileUI <- function(id) { - ns <- shiny::NS(id) - shiny::tagList( - shiny::fileInput( - inputId = ns("file"), - label = "Upload a file", - multiple = FALSE, - accept = c( - ".csv", - ".xlsx", - ".xls", - ".dta", - ".ods", - ".rds" - ) - ), - shiny::h4("Parameter specifications"), - shiny::helpText(shiny::em("Select the desired variables and press 'Submit'")), - shiny::uiOutput(ns("include_vars")), - DT::DTOutput(ns("data_input")), - shiny::actionButton(ns("submit"), "Submit") - ) -} - -m_datafileServer <- function(id, output.format = "df") { - shiny::moduleServer(id, function(input, output, session, ...) { - ns <- shiny::NS(id) - ds <- shiny::reactive({ - REDCapCAST::read_input(input$file$datapath) |> REDCapCAST::parse_data() - }) - - output$include_vars <- shiny::renderUI({ - shiny::req(input$file) - shiny::selectizeInput( - inputId = ns("include_vars"), - selected = NULL, - label = "Covariables to include", - choices = colnames(ds()), - multiple = TRUE - ) - }) - - base_vars <- shiny::reactive({ - if (is.null(input$include_vars)) { - out <- colnames(ds()) - } else { - out <- input$include_vars - } - out - }) - - output$data_input <- - DT::renderDT({ - shiny::req(input$file) - ds()[base_vars()] - }) - - shiny::eventReactive(input$submit, { - # shiny::req(input$file) - - data <- shiny::isolate({ - ds()[base_vars()] - }) - - file_export(data, - output.format = output.format, - tools::file_path_sans_ext(input$file$name) - ) - }) - }) -} - - - - - -file_app <- function() { - ui <- shiny::fluidPage( - m_datafileUI("data"), - # DT::DTOutput(outputId = "redcap_prev") - toastui::datagridOutput2(outputId = "redcap_prev") - ) - server <- function(input, output, session) { - m_datafileServer("data", output.format = "list") - } - shiny::shinyApp(ui, server) -} - -file_app() - -tdm_data_upload <- teal::teal_data_module( - ui <- function(id) { - shiny::fluidPage( - m_datafileUI(id) - ) - }, - server = function(id) { - m_datafileServer(id, output.format = "teal") - } -) - -tdm_data_read <- teal::teal_data_module( - ui <- function(id) { - shiny::fluidPage( - m_redcap_readUI(id = "redcap") - ) - }, - server = function(id) { - moduleServer( - id, - function(input, output, session) { - ns <- session$ns - - m_redcap_readServer(id = "redcap", output.format = "teal") - } - ) - } -) +#' base_vars <- shiny::reactive({ +#' if (is.null(input$include_vars)) { +#' out <- colnames(ds()) +#' } else { +#' out <- input$include_vars +#' } +#' out +#' }) +#' +#' output$data_input <- +#' DT::renderDT({ +#' shiny::req(input$file) +#' ds()[base_vars()] +#' }) +#' +#' shiny::eventReactive(input$submit, { +#' # shiny::req(input$file) +#' +#' data <- shiny::isolate({ +#' ds()[base_vars()] +#' }) +#' +#' file_export(data, +#' output.format = output.format, +#' tools::file_path_sans_ext(input$file$name) +#' ) +#' }) +#' }) +#' } +#' +#' +#' +#' +#' +#' file_app <- function() { +#' ui <- shiny::fluidPage( +#' m_datafileUI("data"), +#' # DT::DTOutput(outputId = "redcap_prev") +#' toastui::datagridOutput2(outputId = "redcap_prev") +#' ) +#' server <- function(input, output, session) { +#' m_datafileServer("data", output.format = "list") +#' } +#' shiny::shinyApp(ui, server) +#' } +#' +#' file_app() +#' +#' tdm_data_upload <- teal::teal_data_module( +#' ui <- function(id) { +#' shiny::fluidPage( +#' m_datafileUI(id) +#' ) +#' }, +#' server = function(id) { +#' m_datafileServer(id, output.format = "teal") +#' } +#' ) +#' +#' tdm_data_read <- teal::teal_data_module( +#' ui <- function(id) { +#' shiny::fluidPage( +#' m_redcap_readUI(id = "redcap") +#' ) +#' }, +#' server = function(id) { +#' moduleServer( +#' id, +#' function(input, output, session) { +#' ns <- session$ns +#' +#' m_redcap_readServer(id = "redcap", output.format = "teal") +#' } +#' ) +#' } +#' ) diff --git a/R/helpers.R b/R/helpers.R index 1cf91db..a99f382 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -98,6 +98,7 @@ argsstring2list <- function(string) { #' @param vars variables to force factorize #' #' @return data.frame +#' @importFrom REDCapCAST as_factor #' @export factorize <- function(data, vars) { if (!is.null(vars)) { @@ -105,7 +106,7 @@ factorize <- function(data, vars) { dplyr::mutate( dplyr::across( dplyr::all_of(vars), - REDCapCAST::as_factor + as_factor ) ) } else { @@ -128,6 +129,17 @@ dummy_Imports <- function() { } +#' Title +#' +#' @param data data +#' @param output.format output +#' @param filename filename +#' @param ... passed on +#' +#' @returns data +#' @export +#' @importFrom REDCapCAST as_factor parse_data numchar2fct +#' file_export <- function(data, output.format = c("df", "teal", "list"), filename, ...) { output.format <- match.arg(output.format) @@ -139,9 +151,9 @@ file_export <- function(data, output.format = c("df", "teal", "list"), filename, { assign(name, value |> dplyr::bind_cols() |> - REDCapCAST::parse_data() |> - REDCapCAST::as_factor() |> - REDCapCAST::numchar2fct()) + parse_data() |> + as_factor() |> + numchar2fct()) }, value = data, name = filename @@ -150,9 +162,9 @@ file_export <- function(data, output.format = c("df", "teal", "list"), filename, datanames(out) <- filename } else if (output.format == "df") { out <- data|> - REDCapCAST::parse_data() |> - REDCapCAST::as_factor() |> - REDCapCAST::numchar2fct() + parse_data() |> + as_factor() |> + numchar2fct() } else if (output.format == "list") { out <- list( data = data, @@ -172,13 +184,14 @@ file_export <- function(data, output.format = c("df", "teal", "list"), filename, #' #' @returns data.frame or tibble #' @export +#' @importFrom REDCapCAST as_factor parse_data numchar2fct #' #' @examples #' mtcars |> str() #' mtcars |> default_parsing() |> str() default_parsing <- function(data){ data |> - REDCapCAST::parse_data() |> - REDCapCAST::as_factor() |> - REDCapCAST::numchar2fct() + parse_data() |> + as_factor() |> + numchar2fct() } diff --git a/R/redcap_read_shiny_module.R b/R/redcap_read_shiny_module.R index 061a6e7..b486498 100644 --- a/R/redcap_read_shiny_module.R +++ b/R/redcap_read_shiny_module.R @@ -100,6 +100,7 @@ m_redcap_readUI <- function(id, include_title = TRUE) { #' #' @return shiny server module #' @export +#' @importFrom REDCapCAST read_redcap_tables redcap_wider suffix2label #' m_redcap_readServer <- function(id, output.format = c("df", "teal", "list")) { output.format <- match.arg(output.format) @@ -226,7 +227,7 @@ m_redcap_readServer <- function(id, output.format = c("df", "teal", "list")) { shiny::req(input$fields) record_id <- dd()[[1]][1] - redcap_data <- REDCapCAST::read_redcap_tables( + redcap_data <- read_redcap_tables( uri = input$uri, token = input$api, fields = unique(c(record_id, input$fields)), @@ -235,10 +236,10 @@ m_redcap_readServer <- function(id, output.format = c("df", "teal", "list")) { raw_or_label = "both", filter_logic = input$filter ) |> - REDCapCAST::redcap_wider() |> + redcap_wider() |> dplyr::select(-dplyr::ends_with("_complete")) |> dplyr::select(-dplyr::any_of(record_id)) |> - REDCapCAST::suffix2label() + suffix2label() out_object <- file_export(redcap_data, output.format = output.format, diff --git a/R/regression_model.R b/R/regression_model.R index d9d4529..8d6f188 100644 --- a/R/regression_model.R +++ b/R/regression_model.R @@ -10,6 +10,7 @@ #' @param ... ignored for now #' #' @importFrom stats as.formula +#' @importFrom REDCapCAST as_factor #' #' @return object of standard class for fun #' @export @@ -66,7 +67,7 @@ regression_model <- function(data, data <- data |> purrr::map(\(.x){ if (is.character(.x)) { - suppressWarnings(REDCapCAST::as_factor(.x)) + suppressWarnings(as_factor(.x)) } else { .x } diff --git a/R/regression_table.R b/R/regression_table.R index 5bb6565..4a7fce6 100644 --- a/R/regression_table.R +++ b/R/regression_table.R @@ -81,7 +81,7 @@ #' #' @export #' regression_table.default <- function(x, ..., args.list = NULL, fun = "gtsummary::tbl_regression") { #' # Stripping custom class -#' class(x) <- class(x)[class(x) != "webresearch_model"] +#' class(x) <- class(x)[class(x) != "freesearcher_model"] #' #' if (any(c(length(class(x)) != 1, class(x) != "lm"))) { #' if (!"exponentiate" %in% names(args.list)) { @@ -110,7 +110,7 @@ regression_table <- function(x, ...) { regression_table_create <- function(x, ..., args.list = NULL, fun = "gtsummary::tbl_regression") { # Stripping custom class - class(x) <- class(x)[class(x) != "webresearch_model"] + class(x) <- class(x)[class(x) != "freesearcher_model"] if (any(c(length(class(x)) != 1, class(x) != "lm"))) { if (!"exponentiate" %in% names(args.list)) { diff --git a/R/shiny_freesearcheR.R b/R/shiny_freesearcheR.R new file mode 100644 index 0000000..033ea00 --- /dev/null +++ b/R/shiny_freesearcheR.R @@ -0,0 +1,25 @@ +#' Launch the freesearcheR tool locally +#' +#' @description +#' All data.frames in the global environment will be accessible through the app. +#' +#' +#' @param ... arguments passed on to `shiny::runApp()` +#' +#' @return shiny app +#' @export +#' +#' @examples +#' \dontrun{ +#' data(mtcars) +#' shiny_freesearcheR(launch.browser = TRUE) +#' } +shiny_freesearcheR <- function(...) { + appDir <- system.file("apps", "data_analysis_modules", package = "freesearcheR") + if (appDir == "") { + stop("Could not find the app directory. Try re-installing `freesearcheR`.", call. = FALSE) + } + + a <- shiny::runApp(appDir = paste0(appDir,"/app.R"), ...) + return(invisible(a)) +} diff --git a/R/shiny_webResearch.R b/R/shiny_webResearch.R deleted file mode 100644 index af55ccf..0000000 --- a/R/shiny_webResearch.R +++ /dev/null @@ -1,27 +0,0 @@ -#' Test version of the shiny_cast function to launch the app with a data set in -#' the environment. -#' -#' @param data optional data set to provide for analysis -#' @param ... arguments passed on to `shiny::runApp()` -#' -#' @return shiny app -#' @export -#' -#' @examples -#' \dontrun{ -#' mtcars |> shiny_webResearch(launch.browser = TRUE) -#' } -shiny_webResearch <- function(data = NULL, ...) { - appDir <- system.file("apps", "data_analysis_modules", package = "webResearch") - if (appDir == "") { - stop("Could not find the app directory. Try re-installing `webResearch`.", call. = FALSE) - } - - G <- .GlobalEnv - - if (!is.null(data) && is.data.frame(data)) { - assign("webResearch_data", data, envir = G) - } - a <- shiny::runApp(appDir = appDir, ...) - return(invisible(a)) -} diff --git a/README.md b/README.md index 05366f4..fb4eb86 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,58 @@ -# webResearch +# freesearcheR -This package is the backbone of the open and freely accessible browser-based data analysis tool with project name "webResearch". +This package is the backbone of the free and open browser based data exploration and analysis tool with publication ready output. -## Road map +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. -- A minimally working example +As of 2024-12-19 the ***freesearcheR***-tool is online and accessible here: [link to shinyapps.io free hosting](https://agdamsbo.shinyapps.io/freesearcheR/). All feedback is welcome and can be shared as a GitHub issue. - - Table 1 of baseline characteristics - - Table 2 of main analysis results - - Figure 1 of main results (like forest plot) - - Shiny GUI implementation +Initiatives for to start funding to continue development of the tool and surrounding initiatives will start soon. -- Fundraising for further development +## Roadmap -- Implementation with different focus groups and educational formats. +- [ ] 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 labels + +- [ ] Plot regression analyses results + +- [ ] Export modified data + +- [ ] Include reproducible code for all steps + +- [x] ~~Modify factor levels~~ Factor level modifications 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 + + +## Install locally + +The ***freesearcheR***-tool can also be launched locally. Any data.frame available in the global environment will be accessible from the interface. + +``` +require("devtools") +devtools::install_github("agdamsbo/freesearcheR") +library(freesearcheR) + +``` + + +## Code of Conduct + +Please note that the freesearcheR project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. diff --git a/webResearch.Rproj b/freesearcheR.Rproj similarity index 100% rename from webResearch.Rproj rename to freesearcheR.Rproj diff --git a/inst/apps/data_analysis/server.R b/inst/apps/data_analysis/server.R index 76dad1d..45361d1 100644 --- a/inst/apps/data_analysis/server.R +++ b/inst/apps/data_analysis/server.R @@ -1,7 +1,3 @@ -# project.aid::merge_scripts(list.files("R/",full.names = TRUE),dest = here::here("app/functions.R")) -# source(here::here("app/functions.R")) - -# source("https://raw.githubusercontent.com/agdamsbo/webResearch/refs/heads/main/app/functions.R") library(readr) library(MASS) @@ -19,7 +15,7 @@ library(quarto) library(here) library(broom) library(broom.helpers) -library(REDCapCAST) +# library(REDCapCAST) library(easystats) library(patchwork) library(DHARMa) @@ -32,6 +28,17 @@ if (file.exists(here::here("functions.R"))) { source(here::here("functions.R")) } +#' freesearcheR server +#' +#' @param input input +#' @param output output +#' @param session session +#' +#' @returns server +#' @export +#' @importFrom REDCapCAST numchar2fct +#' +#' @examples server <- function(input, output, session) { ## Listing files in www in session start to keep when ending and removing ## everything else. @@ -68,7 +75,7 @@ server <- function(input, output, session) { out <- out |> (\(.x){ suppressWarnings( - REDCapCAST::numchar2fct(.x) + numchar2fct(.x) ) })() } diff --git a/inst/apps/data_analysis_modules/app.R b/inst/apps/data_analysis_modules/app.R index 0ec37d4..5acd7c6 100644 --- a/inst/apps/data_analysis_modules/app.R +++ b/inst/apps/data_analysis_modules/app.R @@ -1,7 +1,7 @@ ######## -#### Current file: /Users/au301842/webResearch/inst/apps/data_analysis_modules/functions.R +#### Current file: /Users/au301842/freesearcheR/inst/apps/data_analysis_modules/functions.R ######## @@ -249,6 +249,8 @@ cut.Date <- function(x,breaks,start.on.monday=TRUE,...){ + + is_any_class <- function(data, class.vec) { any(class(data) %in% class.vec) } @@ -685,124 +687,124 @@ plot_histogram <- function(data, column, bins = 30, breaks = NULL, color = "#112 -m_datafileUI <- function(id) { - ns <- shiny::NS(id) - shiny::tagList( - shiny::fileInput( - inputId = ns("file"), - label = "Upload a file", - multiple = FALSE, - accept = c( - ".csv", - ".xlsx", - ".xls", - ".dta", - ".ods", - ".rds" - ) - ), - shiny::h4("Parameter specifications"), - shiny::helpText(shiny::em("Select the desired variables and press 'Submit'")), - shiny::uiOutput(ns("include_vars")), - DT::DTOutput(ns("data_input")), - shiny::actionButton(ns("submit"), "Submit") - ) -} - -m_datafileServer <- function(id, output.format = "df") { - shiny::moduleServer(id, function(input, output, session, ...) { - ns <- shiny::NS(id) - ds <- shiny::reactive({ - REDCapCAST::read_input(input$file$datapath) |> REDCapCAST::parse_data() - }) - - output$include_vars <- shiny::renderUI({ - shiny::req(input$file) - shiny::selectizeInput( - inputId = ns("include_vars"), - selected = NULL, - label = "Covariables to include", - choices = colnames(ds()), - multiple = TRUE - ) - }) - - base_vars <- shiny::reactive({ - if (is.null(input$include_vars)) { - out <- colnames(ds()) - } else { - out <- input$include_vars - } - out - }) - - output$data_input <- - DT::renderDT({ - shiny::req(input$file) - ds()[base_vars()] - }) - - shiny::eventReactive(input$submit, { - # shiny::req(input$file) - - data <- shiny::isolate({ - ds()[base_vars()] - }) - - file_export(data, - output.format = output.format, - tools::file_path_sans_ext(input$file$name) - ) - }) - }) -} -file_app <- function() { - ui <- shiny::fluidPage( - m_datafileUI("data"), - # DT::DTOutput(outputId = "redcap_prev") - toastui::datagridOutput2(outputId = "redcap_prev") - ) - server <- function(input, output, session) { - m_datafileServer("data", output.format = "list") - } - shiny::shinyApp(ui, server) -} -file_app() -tdm_data_upload <- teal::teal_data_module( - ui <- function(id) { - shiny::fluidPage( - m_datafileUI(id) - ) - }, - server = function(id) { - m_datafileServer(id, output.format = "teal") - } -) -tdm_data_read <- teal::teal_data_module( - ui <- function(id) { - shiny::fluidPage( - m_redcap_readUI(id = "redcap") - ) - }, - server = function(id) { - moduleServer( - id, - function(input, output, session) { - ns <- session$ns - m_redcap_readServer(id = "redcap", output.format = "teal") - } - ) - } -) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ######## @@ -910,13 +912,14 @@ argsstring2list <- function(string) { + factorize <- function(data, vars) { if (!is.null(vars)) { data |> dplyr::mutate( dplyr::across( dplyr::all_of(vars), - REDCapCAST::as_factor + as_factor ) ) } else { @@ -939,6 +942,18 @@ dummy_Imports <- function() { } + + + + + + + + + + + + file_export <- function(data, output.format = c("df", "teal", "list"), filename, ...) { output.format <- match.arg(output.format) @@ -950,9 +965,9 @@ file_export <- function(data, output.format = c("df", "teal", "list"), filename, { assign(name, value |> dplyr::bind_cols() |> - REDCapCAST::parse_data() |> - REDCapCAST::as_factor() |> - REDCapCAST::numchar2fct()) + parse_data() |> + as_factor() |> + numchar2fct()) }, value = data, name = filename @@ -961,9 +976,9 @@ file_export <- function(data, output.format = c("df", "teal", "list"), filename, datanames(out) <- filename } else if (output.format == "df") { out <- data|> - REDCapCAST::parse_data() |> - REDCapCAST::as_factor() |> - REDCapCAST::numchar2fct() + parse_data() |> + as_factor() |> + numchar2fct() } else if (output.format == "list") { out <- list( data = data, @@ -987,11 +1002,12 @@ file_export <- function(data, output.format = c("df", "teal", "list"), filename, + default_parsing <- function(data){ data |> - REDCapCAST::parse_data() |> - REDCapCAST::as_factor() |> - REDCapCAST::numchar2fct() + parse_data() |> + as_factor() |> + numchar2fct() } @@ -1102,6 +1118,7 @@ m_redcap_readUI <- function(id, include_title = TRUE) { + m_redcap_readServer <- function(id, output.format = c("df", "teal", "list")) { output.format <- match.arg(output.format) @@ -1227,7 +1244,7 @@ m_redcap_readServer <- function(id, output.format = c("df", "teal", "list")) { shiny::req(input$fields) record_id <- dd()[[1]][1] - redcap_data <- REDCapCAST::read_redcap_tables( + redcap_data <- read_redcap_tables( uri = input$uri, token = input$api, fields = unique(c(record_id, input$fields)), @@ -1236,10 +1253,10 @@ m_redcap_readServer <- function(id, output.format = c("df", "teal", "list")) { raw_or_label = "both", filter_logic = input$filter ) |> - REDCapCAST::redcap_wider() |> + redcap_wider() |> dplyr::select(-dplyr::ends_with("_complete")) |> dplyr::select(-dplyr::any_of(record_id)) |> - REDCapCAST::suffix2label() + suffix2label() out_object <- file_export(redcap_data, output.format = output.format, @@ -1400,6 +1417,7 @@ redcap_app <- function() { + regression_model <- function(data, @@ -1437,7 +1455,7 @@ regression_model <- function(data, data <- data |> purrr::map(\(.x){ if (is.character(.x)) { - suppressWarnings(REDCapCAST::as_factor(.x)) + suppressWarnings(as_factor(.x)) } else { .x } @@ -1691,7 +1709,7 @@ regression_table <- function(x, ...) { regression_table_create <- function(x, ..., args.list = NULL, fun = "gtsummary::tbl_regression") { # Stripping custom class - class(x) <- class(x)[class(x) != "webresearch_model"] + class(x) <- class(x)[class(x) != "freesearcher_model"] if (any(c(length(class(x)) != 1, class(x) != "lm"))) { if (!"exponentiate" %in% names(args.list)) { @@ -1811,7 +1829,7 @@ modify_qmd <- function(file, format) { ######## -#### Current file: R//shiny_webResearch.R +#### Current file: R//shiny_freesearcheR.R ######## @@ -1827,18 +1845,16 @@ modify_qmd <- function(file, format) { -shiny_webResearch <- function(data = NULL, ...) { - appDir <- system.file("apps", "data_analysis_modules", package = "webResearch") + + + +shiny_freesearcheR <- function(...) { + appDir <- system.file("apps", "data_analysis_modules", package = "freesearcheR") if (appDir == "") { - stop("Could not find the app directory. Try re-installing `webResearch`.", call. = FALSE) + stop("Could not find the app directory. Try re-installing `freesearcheR`.", call. = FALSE) } - G <- .GlobalEnv - - if (!is.null(data) && is.data.frame(data)) { - assign("webResearch_data", data, envir = G) - } - a <- shiny::runApp(appDir = appDir, ...) + a <- shiny::runApp(appDir = paste0(appDir,"/app.R"), ...) return(invisible(a)) } @@ -1885,7 +1901,7 @@ custom_theme <- function(..., ######## -#### Current file: /Users/au301842/webResearch/inst/apps/data_analysis_modules/ui.R +#### Current file: /Users/au301842/freesearcheR/inst/apps/data_analysis_modules/ui.R ######## # ns <- NS(id) @@ -2214,7 +2230,7 @@ ui <- bslib::page_fluid( "Data is only stored for analyses and deleted immediately afterwards."), shiny::p( style = "margin: 1; color: #888;", - "Andreas G Damsbo | AGPLv3 license | ", shiny::tags$a("Source on Github", href = "https://github.com/agdamsbo/webResearch/", target="_blank", rel="noopener noreferrer") + "Andreas G Damsbo | AGPLv3 license | ", shiny::tags$a("Source on Github", href = "https://github.com/agdamsbo/freesearcheR/", target="_blank", rel="noopener noreferrer") ), ) ) @@ -2222,14 +2238,9 @@ ui <- bslib::page_fluid( ######## -#### Current file: /Users/au301842/webResearch/inst/apps/data_analysis_modules/server.R +#### Current file: /Users/au301842/freesearcheR/inst/apps/data_analysis_modules/server.R ######## -# project.aid::merge_scripts(list.files("R/",full.names = TRUE),dest = here::here("app/functions.R")) -# source(here::here("app/functions.R")) - -# source("https://raw.githubusercontent.com/agdamsbo/webResearch/refs/heads/main/app/functions.R") - library(readr) library(MASS) library(stats) @@ -2246,7 +2257,7 @@ library(quarto) library(here) library(broom) library(broom.helpers) -library(REDCapCAST) +# library(REDCapCAST) library(easystats) library(patchwork) library(DHARMa) @@ -2255,10 +2266,7 @@ library(toastui) library(IDEAFilter) library(shinyWidgets) library(DT) -# if (!requireNamespace("webResearch")) { -# devtools::install_github("agdamsbo/webResearch", quiet = TRUE, upgrade = "never") -# } -# library(webResearch) +# library(freesearcheR) # source("functions.R") @@ -2269,7 +2277,17 @@ library(DT) # dark <- custom_theme(bg = "#000",fg="#fff") - +#' freesearcheR server +#' +#' @param input input +#' @param output output +#' @param session session +#' +#' @returns server +#' @export +#' @importFrom REDCapCAST fct_drop.data.frame +#' +#' @examples server <- function(input, output, session) { ## Listing files in www in session start to keep when ending and removing ## everything else. @@ -2308,7 +2326,6 @@ server <- function(input, output, session) { rv <- shiny::reactiveValues( list = list(), ds = NULL, - input = exists("webResearch_data"), local_temp = NULL, ready = NULL, test = "no", @@ -2373,33 +2390,6 @@ server <- function(input, output, session) { rv$data_original <- from_env$data() }) - # ds <- - # shiny::reactive({ - # # input$file1 will be NULL initially. After the user selects - # # and uploads a file, head of that data file by default, - # # or all rows if selected, will be shown. - # # if (v$input) { - # # out <- webResearch_data - # # } else if (input$source == "file") { - # # req(data_file$data()) - # # out <- data_file$data() - # # } else if (input$source == "redcap") { - # # req(purrr::pluck(data_redcap(), "data")()) - # # out <- purrr::pluck(data_redcap(), "data")() - # # } - # - # req(rv$data_original) - # - # rv$ds <- "loaded" - # - # rv$data <- rv$data_original - # - # - # # rv$data <- rv$data_original - # - # # rv$data_original - # }) - ############################################################################## ######### ######### Data modification section @@ -2589,7 +2579,7 @@ server <- function(input, output, session) { { data <- data_filter() |> dplyr::mutate(dplyr::across(dplyr::where(is.character), as.factor)) |> - REDCapCAST::fct_drop.data.frame() |> + fct_drop.data.frame() |> factorize(vars = input$factor_vars) if (input$strat_var == "none") { @@ -2809,7 +2799,7 @@ server <- function(input, output, session) { ######## -#### Current file: /Users/au301842/webResearch/inst/apps/data_analysis_modules/launch.R +#### Current file: /Users/au301842/freesearcheR/inst/apps/data_analysis_modules/launch.R ######## shinyApp(ui, server) diff --git a/inst/apps/data_analysis_modules/server.R b/inst/apps/data_analysis_modules/server.R index 8203371..719a763 100644 --- a/inst/apps/data_analysis_modules/server.R +++ b/inst/apps/data_analysis_modules/server.R @@ -1,8 +1,3 @@ -# project.aid::merge_scripts(list.files("R/",full.names = TRUE),dest = here::here("app/functions.R")) -# source(here::here("app/functions.R")) - -# source("https://raw.githubusercontent.com/agdamsbo/webResearch/refs/heads/main/app/functions.R") - library(readr) library(MASS) library(stats) @@ -19,7 +14,7 @@ library(quarto) library(here) library(broom) library(broom.helpers) -library(REDCapCAST) +# library(REDCapCAST) library(easystats) library(patchwork) library(DHARMa) @@ -28,10 +23,7 @@ library(toastui) library(IDEAFilter) library(shinyWidgets) library(DT) -# if (!requireNamespace("webResearch")) { -# devtools::install_github("agdamsbo/webResearch", quiet = TRUE, upgrade = "never") -# } -# library(webResearch) +# library(freesearcheR) # source("functions.R") @@ -42,7 +34,17 @@ library(DT) # dark <- custom_theme(bg = "#000",fg="#fff") - +#' freesearcheR server +#' +#' @param input input +#' @param output output +#' @param session session +#' +#' @returns server +#' @export +#' @importFrom REDCapCAST fct_drop.data.frame +#' +#' @examples server <- function(input, output, session) { ## Listing files in www in session start to keep when ending and removing ## everything else. @@ -81,7 +83,6 @@ server <- function(input, output, session) { rv <- shiny::reactiveValues( list = list(), ds = NULL, - input = exists("webResearch_data"), local_temp = NULL, ready = NULL, test = "no", @@ -146,33 +147,6 @@ server <- function(input, output, session) { rv$data_original <- from_env$data() }) - # ds <- - # shiny::reactive({ - # # input$file1 will be NULL initially. After the user selects - # # and uploads a file, head of that data file by default, - # # or all rows if selected, will be shown. - # # if (v$input) { - # # out <- webResearch_data - # # } else if (input$source == "file") { - # # req(data_file$data()) - # # out <- data_file$data() - # # } else if (input$source == "redcap") { - # # req(purrr::pluck(data_redcap(), "data")()) - # # out <- purrr::pluck(data_redcap(), "data")() - # # } - # - # req(rv$data_original) - # - # rv$ds <- "loaded" - # - # rv$data <- rv$data_original - # - # - # # rv$data <- rv$data_original - # - # # rv$data_original - # }) - ############################################################################## ######### ######### Data modification section @@ -362,7 +336,7 @@ server <- function(input, output, session) { { data <- data_filter() |> dplyr::mutate(dplyr::across(dplyr::where(is.character), as.factor)) |> - REDCapCAST::fct_drop.data.frame() |> + fct_drop.data.frame() |> factorize(vars = input$factor_vars) if (input$strat_var == "none") { diff --git a/inst/apps/data_analysis_modules/ui.R b/inst/apps/data_analysis_modules/ui.R index b929c84..f16edd6 100644 --- a/inst/apps/data_analysis_modules/ui.R +++ b/inst/apps/data_analysis_modules/ui.R @@ -324,7 +324,7 @@ ui <- bslib::page_fluid( "Data is only stored for analyses and deleted immediately afterwards."), shiny::p( style = "margin: 1; color: #888;", - "Andreas G Damsbo | AGPLv3 license | ", shiny::tags$a("Source on Github", href = "https://github.com/agdamsbo/webResearch/", target="_blank", rel="noopener noreferrer") + "Andreas G Damsbo | AGPLv3 license | ", shiny::tags$a("Source on Github", href = "https://github.com/agdamsbo/freesearcheR/", target="_blank", rel="noopener noreferrer") ), ) ) diff --git a/inst/apps/data_analysis_modules/www/docs.html b/inst/apps/data_analysis_modules/www/docs.html index 8e610fb..f81c0e8 100644 --- a/inst/apps/data_analysis_modules/www/docs.html +++ b/inst/apps/data_analysis_modules/www/docs.html @@ -40,7 +40,7 @@ margin: 0 0.8em 0.2em -1em; vertical-align: middle;

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.

+

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

  • @@ -58,8 +58,8 @@ margin: 0 0.8em 0.2em -1em; vertical-align: middle;
  • -
  • -
  • +
  • +
diff --git a/inst/apps/data_analysis_modules/www/docs.md b/inst/apps/data_analysis_modules/www/docs.md deleted file mode 100644 index 652850a..0000000 --- a/inst/apps/data_analysis_modules/www/docs.md +++ /dev/null @@ -1,34 +0,0 @@ -# Documentation on the freesearcheR platform - -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. - - -## Roadmap - -- [ ] Stratified analyses - -- Additional study designs: - - - [x] Cross-sectional data analyses - - - [ ] Longitudinal data analyses - - - [ ] Survival analysis - -- More detailed variable browser - - - [ ] Add histograms for datadistribution - - - [ ] Option to edit labels - -- [ ] Plot regression analyses results - -- [ ] Export modified data - -- [ ] Include reproducible code for all steps - -- [ ] Modify factor levels - -- [ ] More options for date/datetime/time grouping/factoring diff --git a/inst/apps/data_analysis_modules/www/docs.qmd b/inst/apps/data_analysis_modules/www/docs.qmd index be633f4..aced028 100644 --- a/inst/apps/data_analysis_modules/www/docs.qmd +++ b/inst/apps/data_analysis_modules/www/docs.qmd @@ -14,7 +14,7 @@ Below will be a more detailed description of the included features and possibili ## 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/webResearch/issues). +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 @@ -40,6 +40,6 @@ Contributions are very welcome. If you find anything odd, or you think of featur - [ ] Include reproducible code for all steps -- [ ] Modify factor levels (including naming, order, collapsing, removing) +- [x] ~~Modify factor levels~~ Factor level modification is possible through converting factors to numeric > cutting numeric with desired fixed values. 2024-12-12 -- [ ] More options for date/datetime/time grouping/factoring +- [x] More options for date/datetime/time grouping/factoring. Included weekday and month-only options. 2024-12-12 diff --git a/inst/apps/teal_test/app.R b/inst/apps/teal_test/app.R index 76a194c..d729897 100644 --- a/inst/apps/teal_test/app.R +++ b/inst/apps/teal_test/app.R @@ -56,8 +56,8 @@ tm_variable_browser_module <- tm_variable_browser( filters <- teal::teal_slices() -app_source <- "https://github.com/agdamsbo/webresearch" -gh_issues_page <- "https://github.com/agdamsbo/webresearch/issues" +app_source <- "https://github.com/agdamsbo/freesearcheR" +gh_issues_page <- "https://github.com/agdamsbo/freesearcheR/issues" header <- tags$span( style = "display: flex; align-items: center; justify-content: space-between; margin: 10px 0 10px 0;", diff --git a/man/file_export.Rd b/man/file_export.Rd new file mode 100644 index 0000000..81459db --- /dev/null +++ b/man/file_export.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/helpers.R +\name{file_export} +\alias{file_export} +\title{Title} +\usage{ +file_export(data, output.format = c("df", "teal", "list"), filename, ...) +} +\arguments{ +\item{data}{data} + +\item{output.format}{output} + +\item{filename}{filename} + +\item{...}{passed on} +} +\value{ +data +} +\description{ +Title +} diff --git a/man/is_any_class.Rd b/man/is_any_class.Rd index 6aa32b3..d441653 100644 --- a/man/is_any_class.Rd +++ b/man/is_any_class.Rd @@ -18,7 +18,9 @@ factor Test class } \examples{ +\dontrun{ vapply(REDCapCAST::redcapcast_data, \(.x){ is_any_class(.x, c("hms", "Date", "POSIXct", "POSIXt")) }, logical(1)) } +} diff --git a/man/m_datafileUI.Rd b/man/m_datafileUI.Rd deleted file mode 100644 index c10a254..0000000 --- a/man/m_datafileUI.Rd +++ /dev/null @@ -1,17 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/file-import-module.R -\name{m_datafileUI} -\alias{m_datafileUI} -\title{Shiny UI module to load a data file} -\usage{ -m_datafileUI(id) -} -\arguments{ -\item{id}{id} -} -\value{ -shiny UI -} -\description{ -Shiny UI module to load a data file -} diff --git a/man/regression_table.Rd b/man/regression_table.Rd index ee96951..946fc8a 100644 --- a/man/regression_table.Rd +++ b/man/regression_table.Rd @@ -93,7 +93,7 @@ regression_table.list <- function(x, ...) { #' @export regression_table.default <- function(x, ..., args.list = NULL, fun = "gtsummary::tbl_regression") { # Stripping custom class - class(x) <- class(x)[class(x) != "webresearch_model"] + class(x) <- class(x)[class(x) != "freesearcher_model"] if (any(c(length(class(x)) != 1, class(x) != "lm"))) { if (!"exponentiate" \%in\% names(args.list)) { diff --git a/man/shiny_freesearcheR.Rd b/man/shiny_freesearcheR.Rd new file mode 100644 index 0000000..93d8707 --- /dev/null +++ b/man/shiny_freesearcheR.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/shiny_freesearcheR.R +\name{shiny_freesearcheR} +\alias{shiny_freesearcheR} +\title{Launch the freesearcheR tool locally} +\usage{ +shiny_freesearcheR(...) +} +\arguments{ +\item{...}{arguments passed on to \code{shiny::runApp()}} +} +\value{ +shiny app +} +\description{ +All data.frames in the global environment will be accessible through the app. +} +\examples{ +\dontrun{ +data(mtcars) +shiny_freesearcheR(launch.browser = TRUE) +} +} diff --git a/man/shiny_webResearch.Rd b/man/shiny_webResearch.Rd deleted file mode 100644 index 2d23324..0000000 --- a/man/shiny_webResearch.Rd +++ /dev/null @@ -1,26 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/shiny_webResearch.R -\name{shiny_webResearch} -\alias{shiny_webResearch} -\title{Test version of the shiny_cast function to launch the app with a data set in -the environment.} -\usage{ -shiny_webResearch(data = NULL, ...) -} -\arguments{ -\item{data}{optional data set to provide for analysis} - -\item{...}{arguments passed on to \code{shiny::runApp()}} -} -\value{ -shiny app -} -\description{ -Test version of the shiny_cast function to launch the app with a data set in -the environment. -} -\examples{ -\dontrun{ -mtcars |> shiny_webResearch(launch.browser = TRUE) -} -} diff --git a/renv.lock b/renv.lock index 1503813..0868c9d 100644 --- a/renv.lock +++ b/renv.lock @@ -57,27 +57,6 @@ ], "Hash": "64ff3427f559ce3f2597a4fe13255cb6" }, - "Deriv": { - "Package": "Deriv", - "Version": "4.1.6", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "methods" - ], - "Hash": "cd52c065c9e687c60c56b51f10f7bcd3" - }, - "Formula": { - "Package": "Formula", - "Version": "1.2-5", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "stats" - ], - "Hash": "7a29697b75e027767a53fde6c903eca7" - }, "IDEAFilter": { "Package": "IDEAFilter", "Version": "0.2.0", @@ -138,30 +117,6 @@ ], "Hash": "5122bb14d8736372411f955e1b16bc8a" }, - "MatrixModels": { - "Package": "MatrixModels", - "Version": "0.5-3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "Matrix", - "R", - "methods", - "stats" - ], - "Hash": "0776bf7526869e0286b0463cb72fb211" - }, - "PKI": { - "Package": "PKI", - "Version": "0.1-14", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "base64enc" - ], - "Hash": "f5b9c6b2f62f1fa3dd53fd1ddccbb241" - }, "R.cache": { "Package": "R.cache", "Version": "0.16.0", @@ -238,9 +193,13 @@ }, "REDCapCAST": { "Package": "REDCapCAST", - "Version": "24.12.1", - "Source": "Repository", - "Repository": "CRAN", + "Version": "24.11.3", + "Source": "GitHub", + "RemoteType": "github", + "RemoteHost": "api.github.com", + "RemoteRepo": "REDCapCAST", + "RemoteUsername": "agdamsbo", + "RemoteSha": "45315080c596d3c1ea5f2e815ef27d2a50230326", "Requirements": [ "R", "REDCapR", @@ -250,7 +209,6 @@ "forcats", "glue", "gt", - "gtsummary", "haven", "here", "keyring", @@ -265,7 +223,7 @@ "vctrs", "zip" ], - "Hash": "d0925e579ddfbedeb536c5cbf65fc42f" + "Hash": "9a9744292f30f1fb7fad55c2dd2e9baf" }, "REDCapR": { "Package": "REDCapR", @@ -325,20 +283,6 @@ ], "Hash": "a9e2118c664c2cd694f03de074e8d4b3" }, - "SparseM": { - "Package": "SparseM", - "Version": "1.84-2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "graphics", - "methods", - "stats", - "utils" - ], - "Hash": "e78499cbcbbca98200254bd171379165" - }, "V8": { "Package": "V8", "Version": "6.0.0", @@ -352,18 +296,6 @@ ], "Hash": "6603bfcbc7883a5fed41fb13042a3899" }, - "abind": { - "Package": "abind", - "Version": "1.4-8", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "methods", - "utils" - ], - "Hash": "2288423bb0f20a457800d7fc47f6aa54" - }, "ape": { "Package": "ape", "Version": "5.8-1", @@ -605,41 +537,6 @@ ], "Hash": "d7e13f49c19103ece9e58ad2d83a7354" }, - "car": { - "Package": "car", - "Version": "3.1-3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "Formula", - "MASS", - "R", - "abind", - "carData", - "grDevices", - "graphics", - "lme4", - "mgcv", - "nlme", - "nnet", - "pbkrtest", - "quantreg", - "scales", - "stats", - "utils" - ], - "Hash": "82067bf302d1440b730437693a86406a" - }, - "carData": { - "Package": "carData", - "Version": "3.0-5", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "ac6cdb8552c61bd36b0e54d07cf2aab7" - }, "cards": { "Package": "cards", "Version": "0.4.0", @@ -658,9 +555,9 @@ }, "cardx": { "Package": "cardx", - "Version": "0.2.2", + "Version": "0.2.1", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "cards", @@ -671,7 +568,7 @@ "rlang", "tidyr" ], - "Hash": "21f5ce5381d529b08783dca434af3003" + "Hash": "e5458dd65b0602136b16aed802d3bd50" }, "cellranger": { "Package": "cellranger", @@ -794,23 +691,6 @@ ], "Hash": "8b6512d8f60685736ee3bafdc292190d" }, - "cowplot": { - "Package": "cowplot", - "Version": "1.1.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "ggplot2", - "grDevices", - "grid", - "gtable", - "methods", - "rlang", - "scales" - ], - "Hash": "8ef2084dd7d28847b374e55440e4f8cb" - }, "cpp11": { "Package": "cpp11", "Version": "0.5.1", @@ -917,30 +797,6 @@ ], "Hash": "33698c4b3127fc9f506654607fb73676" }, - "doBy": { - "Package": "doBy", - "Version": "4.6.24", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "Deriv", - "MASS", - "Matrix", - "R", - "boot", - "broom", - "cowplot", - "dplyr", - "ggplot2", - "methods", - "microbenchmark", - "modelr", - "rlang", - "tibble", - "tidyr" - ], - "Hash": "8ddf795104defe53c5392a588888ec68" - }, "doParallel": { "Package": "doParallel", "Version": "1.0.17", @@ -1033,34 +889,6 @@ ], "Hash": "b289af101f62cb7b46c53d1a45ed5198" }, - "emmeans": { - "Package": "emmeans", - "Version": "1.10.6", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "estimability", - "graphics", - "methods", - "mvtnorm", - "numDeriv", - "stats", - "utils" - ], - "Hash": "6b0c6fcbdbefe525d2ee713f95880f90" - }, - "estimability": { - "Package": "estimability", - "Version": "1.5.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "stats" - ], - "Hash": "21ec52af13afbcab1cb317567b639b0a" - }, "evaluate": { "Package": "evaluate", "Version": "1.0.1", @@ -1316,25 +1144,6 @@ ], "Hash": "14b3b3b923944afb9542dbef4c68bf4b" }, - "ggmosaic": { - "Package": "ggmosaic", - "Version": "0.3.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "dplyr", - "ggplot2", - "ggrepel", - "plotly", - "productplots", - "purrr", - "rlang", - "scales", - "tidyr" - ], - "Hash": "9c716443a2b821aa997c5675386bd34b" - }, "ggplot2": { "Package": "ggplot2", "Version": "3.5.1", @@ -1360,22 +1169,6 @@ ], "Hash": "44c6a2f8202d5b7e878ea274b1092426" }, - "ggrepel": { - "Package": "ggrepel", - "Version": "0.9.6", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "Rcpp", - "ggplot2", - "grid", - "rlang", - "scales", - "withr" - ], - "Hash": "3d4156850acc1161f2f24bc61c9217c1" - }, "glue": { "Package": "glue", "Version": "1.8.0", @@ -1387,20 +1180,6 @@ ], "Hash": "5899f1eaa825580172bb56c08266f37c" }, - "gridExtra": { - "Package": "gridExtra", - "Version": "2.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "grDevices", - "graphics", - "grid", - "gtable", - "utils" - ], - "Hash": "7d7f283939f563670a697165b2cf5560" - }, "gt": { "Package": "gt", "Version": "0.11.1", @@ -1470,7 +1249,7 @@ "Package": "haven", "Version": "2.5.4", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cli", @@ -1491,7 +1270,7 @@ "Package": "here", "Version": "1.0.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "rprojroot" ], @@ -1512,7 +1291,7 @@ "Package": "hms", "Version": "1.1.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "lifecycle", "methods", @@ -1814,7 +1593,7 @@ }, "lubridate": { "Package": "lubridate", - "Version": "1.9.4", + "Version": "1.9.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1823,7 +1602,7 @@ "methods", "timechange" ], - "Hash": "be38bc740fc51783a78edb5a157e4104" + "Hash": "680ad542fbcf801442c83a6ac5a2126c" }, "magrittr": { "Package": "magrittr", @@ -1876,18 +1655,6 @@ ], "Hash": "110ee9d83b496279960e162ac97764ce" }, - "microbenchmark": { - "Package": "microbenchmark", - "Version": "1.5.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "graphics", - "stats" - ], - "Hash": "f9d226d88d4087d817d4e616626ce8e5" - }, "mime": { "Package": "mime", "Version": "0.12", @@ -1939,24 +1706,6 @@ ], "Hash": "f519814037d08eee1343c2e7b5992cc4" }, - "modelr": { - "Package": "modelr", - "Version": "0.1.11", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "broom", - "magrittr", - "purrr", - "rlang", - "tibble", - "tidyr", - "tidyselect", - "vctrs" - ], - "Hash": "4f50122dc256b1b6996a4703fecea821" - }, "munsell": { "Package": "munsell", "Version": "0.5.1", @@ -1968,17 +1717,6 @@ ], "Hash": "4fd8900853b746af55b81fda99da7695" }, - "mvtnorm": { - "Package": "mvtnorm", - "Version": "1.3-2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "stats" - ], - "Hash": "9e8405eacb262c0a939e121650247f4b" - }, "nlme": { "Package": "nlme", "Version": "3.1-166", @@ -2000,28 +1738,6 @@ "Repository": "CRAN", "Hash": "27550641889a3abf3aec4d91186311ec" }, - "nnet": { - "Package": "nnet", - "Version": "7.3-19", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "stats", - "utils" - ], - "Hash": "2c797b46eea7fb58ede195bc0b1f1138" - }, - "numDeriv": { - "Package": "numDeriv", - "Version": "2016.8-1.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "df58958f293b166e4ab885ebcad90e02" - }, "officer": { "Package": "officer", "Version": "0.6.7", @@ -2089,18 +1805,6 @@ ], "Hash": "c519244e5080a630292e1fdc36717f0d" }, - "packrat": { - "Package": "packrat", - "Version": "0.9.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "tools", - "utils" - ], - "Hash": "55ddd2d4a1959535f18393478b0c14a6" - }, "parameters": { "Package": "parameters", "Version": "0.24.0", @@ -2137,24 +1841,6 @@ ], "Hash": "e23fb9ecb1258207bcb763d78d513439" }, - "pbkrtest": { - "Package": "pbkrtest", - "Version": "0.5.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "MASS", - "Matrix", - "R", - "broom", - "doBy", - "dplyr", - "lme4", - "methods", - "numDeriv" - ], - "Hash": "938e6bbc4ac57534f8b43224506a8966" - }, "pbmcapply": { "Package": "pbmcapply", "Version": "1.5.1", @@ -2194,12 +1880,11 @@ }, "pillar": { "Package": "pillar", - "Version": "1.9.0", + "Version": "1.10.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "cli", - "fansi", "glue", "lifecycle", "rlang", @@ -2207,7 +1892,7 @@ "utils", "vctrs" ], - "Hash": "15da5a8412f317beeee6175fbc76f4bb" + "Hash": "101ca350beea21261a15ba169d7a8513" }, "pkgconfig": { "Package": "pkgconfig", @@ -2299,17 +1984,6 @@ ], "Hash": "0c90a7d71988856bad2a2a45dd871bb9" }, - "productplots": { - "Package": "productplots", - "Version": "0.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "ggplot2", - "plyr" - ], - "Hash": "75630cc31052ba299a52bb1adbf59fae" - }, "progress": { "Package": "progress", "Version": "1.2.3", @@ -2423,24 +2097,6 @@ ], "Hash": "a22b3777f51fd005a7cd4c2bccc385ae" }, - "quantreg": { - "Package": "quantreg", - "Version": "5.99.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "MASS", - "Matrix", - "MatrixModels", - "R", - "SparseM", - "graphics", - "methods", - "stats", - "survival" - ], - "Hash": "c48844cd7961de506a1b4d22b2e082c7" - }, "quarto": { "Package": "quarto", "Version": "1.4.4", @@ -2579,7 +2235,7 @@ "Package": "rematch", "Version": "2.0.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Hash": "cbff1b666c6fa6d21202f07e2318d4f1" }, "renv": { @@ -2706,29 +2362,6 @@ ], "Hash": "4c8415e0ec1e29f3f4f6fc108bef0144" }, - "rsconnect": { - "Package": "rsconnect", - "Version": "1.3.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "PKI", - "R", - "cli", - "curl", - "digest", - "jsonlite", - "lifecycle", - "openssl", - "packrat", - "renv", - "rlang", - "rstudioapi", - "tools", - "yaml" - ], - "Hash": "d466c98fdce812325feb4ad406c6ca4b" - }, "rstudioapi": { "Package": "rstudioapi", "Version": "0.17.1", @@ -2854,22 +2487,6 @@ ], "Hash": "836c3464fb0f2ea865ed4c35dcdc1eda" }, - "shinyTree": { - "Package": "shinyTree", - "Version": "0.3.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "htmlwidgets", - "jsonlite", - "methods", - "promises", - "shiny", - "stringr" - ], - "Hash": "0493a0d70f834cb251fe4523eb17b82c" - }, "shinyWidgets": { "Package": "shinyWidgets", "Version": "0.8.7", @@ -2928,25 +2545,12 @@ ], "Hash": "802e4786b353a4bb27116957558548d5" }, - "shinyvalidate": { - "Package": "shinyvalidate", - "Version": "0.1.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "glue", - "htmltools", - "rlang", - "shiny" - ], - "Hash": "fe6e75a1c1722b2d23cb4d4dbe1006df" - }, "sodium": { "Package": "sodium", - "Version": "1.4.0", + "Version": "1.3.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "ae00d33a499e429a04409bc1167c4995" + "Hash": "869b09ca565ecaa9efc62534ebfa3efd" }, "sourcetools": { "Package": "sourcetools", @@ -3018,22 +2622,6 @@ ], "Hash": "93a2b1beac2437bdcc4724f8bf867e2c" }, - "survival": { - "Package": "survival", - "Version": "3.7-0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "Matrix", - "R", - "graphics", - "methods", - "splines", - "stats", - "utils" - ], - "Hash": "5aaa9cbaf4aba20f8e06fdea1850a398" - }, "sys": { "Package": "sys", "Version": "3.4.3", @@ -3129,44 +2717,6 @@ ], "Hash": "b5d3366368999eb2262c2a646a1f0c87" }, - "teal.modules.general": { - "Package": "teal.modules.general", - "Version": "0.3.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "DT", - "R", - "checkmate", - "dplyr", - "forcats", - "ggmosaic", - "ggplot2", - "grid", - "logger", - "scales", - "shiny", - "shinyTree", - "shinyWidgets", - "shinyjs", - "shinyvalidate", - "stats", - "stringr", - "teal", - "teal.code", - "teal.data", - "teal.logger", - "teal.reporter", - "teal.transform", - "teal.widgets", - "tern", - "tibble", - "tidyr", - "tools", - "utils" - ], - "Hash": "f54d7bc27cd048cec3a842f980c74e9b" - }, "teal.reporter": { "Package": "teal.reporter", "Version": "0.3.1", @@ -3219,31 +2769,6 @@ ], "Hash": "a29de94bc89bad9a12a914c17e8269f1" }, - "teal.transform": { - "Package": "teal.transform", - "Version": "0.5.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "checkmate", - "dplyr", - "lifecycle", - "logger", - "methods", - "rlang", - "shiny", - "shinyjs", - "shinyvalidate", - "stats", - "teal.data", - "teal.logger", - "teal.widgets", - "tidyr", - "tidyselect" - ], - "Hash": "988a30f3f0f20b2633b41103a8eb4e56" - }, "teal.widgets": { "Package": "teal.widgets", "Version": "0.4.2", @@ -3267,42 +2792,6 @@ ], "Hash": "46a99bbdcd97f8f25070ad23c3b23ad9" }, - "tern": { - "Package": "tern", - "Version": "0.9.6", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "MASS", - "R", - "Rdpack", - "broom", - "car", - "checkmate", - "cowplot", - "dplyr", - "emmeans", - "forcats", - "formatters", - "ggplot2", - "grid", - "gridExtra", - "gtable", - "labeling", - "lifecycle", - "magrittr", - "methods", - "rlang", - "rtables", - "scales", - "stats", - "survival", - "tibble", - "tidyr", - "utils" - ], - "Hash": "35fe86bc358b15525217e775f5318d33" - }, "textshaping": { "Package": "textshaping", "Version": "0.4.1", @@ -3447,7 +2936,7 @@ "Package": "tzdb", "Version": "0.4.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cpp11" @@ -3502,7 +2991,7 @@ "Package": "vroom", "Version": "1.6.5", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "bit64", diff --git a/renv/settings.json b/renv/settings.json new file mode 100644 index 0000000..74c1d4b --- /dev/null +++ b/renv/settings.json @@ -0,0 +1,19 @@ +{ + "bioconductor.version": null, + "external.libraries": [], + "ignored.packages": [], + "package.dependency.fields": [ + "Imports", + "Depends", + "LinkingTo" + ], + "ppm.enabled": null, + "ppm.ignored.urls": [], + "r.version": null, + "snapshot.type": "explicit", + "use.cache": true, + "vcs.ignore.cellar": true, + "vcs.ignore.library": true, + "vcs.ignore.local": true, + "vcs.manage.ignores": true +}