new working version with major updates

This commit is contained in:
Andreas Gammelgaard Damsbo 2024-12-17 11:30:17 +01:00
commit e4633421aa
No known key found for this signature in database
16 changed files with 1678 additions and 85 deletions

View file

@ -31,15 +31,19 @@ library(IDEAFilter)
# }
# library(webResearch)
if (file.exists(here::here("functions.R"))) {
source(here::here("functions.R"))
}
source(here::here("functions.R"))
server <- function(input, output, session) {
## Listing files in www in session start to keep when ending and removing
## everything else.
files.to.keep <- list.files("www/")
output$docs_file <- renderUI({
# shiny::includeHTML("www/docs.html")
HTML(readLines("www/docs.html"))
})
rv <- shiny::reactiveValues(
list = NULL,
ds = NULL,
@ -193,7 +197,7 @@ server <- function(input, output, session) {
)
output$original_str <- renderPrint({
str(ds())
str(rv$data_original)
})
output$modified_str <- renderPrint({
@ -290,25 +294,25 @@ server <- function(input, output, session) {
## Have a look at column filters at some point
## There should be a way to use the filtering the filter data for further analyses
## Disabled for now, as the JS is apparently not isolated
output$data_table <-
DT::renderDT(
{
DT::datatable(ds()[base_vars()])
},
server = FALSE
)
output$data.classes <- gt::render_gt({
shiny::req(input$file)
data.frame(matrix(sapply(ds(), \(.x){
class(.x)[1]
}), nrow = 1)) |>
stats::setNames(names(ds())) |>
gt::gt()
})
# output$data_table <-
# DT::renderDT(
# {
# DT::datatable(ds()[base_vars()])
# },
# server = FALSE
# )
#
# output$data.classes <- gt::render_gt({
# shiny::req(input$file)
# data.frame(matrix(sapply(ds(), \(.x){
# class(.x)[1]
# }), nrow = 1)) |>
# stats::setNames(names(ds())) |>
# gt::gt()
# })
shiny::observeEvent(input$act_start, {
bslib::nav_select(id = "main_panel", selected = "Overview and modifications")
bslib::nav_select(id = "main_panel", selected = "Modifications")
})
shiny::observeEvent(

View file

@ -30,17 +30,22 @@ ui_elements <- list(
shinyWidgets::radioGroupButtons(
inputId = "source",
# label = "Choice: ",
choices = c("File upload" = "file", "REDCap server" = "redcap","Sample data"="env"),
checkIcon = list(
yes = icon("square-check"),
no = icon("square")
)
choices = c(
"File upload" = "file",
"REDCap server" = "redcap",
"Sample data" = "env"
),
# checkIcon = list(
# yes = icon("square-check"),
# no = icon("square")
# ),
width = "100%"
),
shiny::conditionalPanel(
condition = "input.source=='file'",
datamods::import_file_ui("file_import",
title = "Choose a datafile to upload",
file_extensions = c(".csv", ".txt", ".xls", ".xlsx", ".rds", ".fst", ".sas7bdat", ".sav", ".ods", ".dta")
title = "Choose a datafile to upload",
file_extensions = c(".csv", ".txt", ".xls", ".xlsx", ".rds", ".fst", ".sas7bdat", ".sav", ".ods", ".dta")
)
),
shiny::conditionalPanel(
@ -57,13 +62,7 @@ ui_elements <- list(
),
column(
width = 6,
shiny::markdown("
# Welcome
This is the ***freesearchR*** web data analysis tool. An opiniotaed tool for easy data analysis at the hands of the clinician.
By intention, this is a focused app, with only few data modification tools included to keep the workflow streamlined.
")
shiny::markdown(readLines("www/intro.md"))
)
),
shiny::conditionalPanel(
@ -79,10 +78,10 @@ ui_elements <- list(
#########
##############################################################################
"overview" =
# bslib::nav_panel_hidden(
# bslib::nav_panel_hidden(
bslib::nav_panel(
# value = "overview",
title = "Overview and modifications",
title = "Modifications",
bslib::navset_bar(
fillable = TRUE,
# bslib::nav_panel(
@ -170,7 +169,7 @@ ui_elements <- list(
#########
##############################################################################
"analyze" =
# bslib::nav_panel_hidden(
# bslib::nav_panel_hidden(
bslib::nav_panel(
# value = "analyze",
title = "Analyses",
@ -230,8 +229,8 @@ ui_elements <- list(
icon = shiny::icon("pencil", lib = "glyphicon"),
label_busy = "Working...",
icon_busy = fontawesome::fa_i("arrows-rotate",
class = "fa-spin",
"aria-hidden" = "true"
class = "fa-spin",
"aria-hidden" = "true"
),
type = "primary",
auto_reset = TRUE
@ -260,7 +259,8 @@ ui_elements <- list(
##############################################################################
"docs" = bslib::nav_panel(
title = "Documentation",
shiny::markdown(readLines(here::here("inst/apps/data_analysis_modules/www/intro.md"))),
# shiny::tags$iframe("www/docs.html", height=600, width=535),
shiny::htmlOutput("docs_file"),
shiny::br()
)
)

View file

@ -0,0 +1,69 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<meta charset="utf-8">
<meta name="generator" content="quarto-1.5.57">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>freesearcheR platform documentation</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1em; vertical-align: middle;
}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
</head>
<body>
<header id="title-block-header">
<h1 class="title"><strong><em>freesearcheR</em></strong> platform documentation</h1>
</header>
<h1 id="welcome">Welcome!</h1>
<p>So glad to see you here! Welcome to test this early concept of a platform to easily explore, manipulate and analyse clinical data.</p>
<p>Below will be a more detailed description of the included features and possibilities, as well as the planned and possible feature additions.</p>
<h2 id="contribute">Contribute</h2>
<p>Contributions are very welcome. If you find anything odd, or you think of features to add or remove, please <a href="https://github.com/agdamsbo/webResearch/issues">share and report on the project page on GitHub</a>.</p>
<h2 id="roadmap">Roadmap</h2>
<ul>
<li><p><label><input type="checkbox">Stratified analyses</label></p></li>
<li><p>Additional study designs:</p>
<ul class="task-list">
<li><p><label><input type="checkbox" checked>Cross-sectional data analyses</label></p></li>
<li><p><label><input type="checkbox">Longitudinal data analyses</label></p></li>
<li><p><label><input type="checkbox">Survival analysis</label></p></li>
</ul></li>
<li><p>More detailed variable browser</p>
<ul class="task-list">
<li><p><label><input type="checkbox">Add histograms for data distribution</label></p></li>
<li><p><label><input type="checkbox">Option to edit variable labels for nicer tables</label></p></li>
</ul></li>
<li><p><label><input type="checkbox">Plot regression analyses results</label></p></li>
<li><p><label><input type="checkbox">Export modified data</label></p></li>
<li><p><label><input type="checkbox">Include reproducible code for all steps</label></p></li>
<li><p><label><input type="checkbox">Modify factor levels (including naming, order, collapsing, removing)</label></p></li>
<li><p><label><input type="checkbox">More options for date/datetime/time grouping/factoring</label></p></li>
</ul>
</body></html>

View file

@ -0,0 +1,34 @@
# 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

View file

@ -0,0 +1,45 @@
---
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/webResearch/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
- [ ] Export modified data
- [ ] Include reproducible code for all steps
- [ ] Modify factor levels (including naming, order, collapsing, removing)
- [ ] More options for date/datetime/time grouping/factoring

View file

@ -1,3 +1,21 @@
# Intro to webResearch/freesearcheR/VOICE
# Welcome
This is just placeholder text.
This is the ***freesearchR*** web data analysis tool. The ***freesearchR*** is an opinioated tool for easy data evaluation and analysis at the hands of the clinician. We intend it to be a powerful to, that is easy and secure to use.
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:
1. Import data (this can be a spreadsheet on your machine or direct export from a REDCap server)
2. A *optional* step of data modification (change variable classes and creating categorical variables (factors) from numeric or time data)
3. Data analysis of cross-sectionally designed studies
- Classic baseline charactieristics (options to stratify and compare variables)
- Linear, dichotomous or ordinal logistic regression will be used depending on specified outcome variable
- Evaluation of model assumptions
4. Export the the analyses results as .docx or .odt.