moving towards first working state

This commit is contained in:
Andreas Gammelgaard Damsbo 2024-11-08 16:31:33 +01:00
commit 4c0a19f09f
No known key found for this signature in database
14 changed files with 75 additions and 1695 deletions

View file

@ -5,6 +5,6 @@ account: agdamsbo
server: shinyapps.io
hostUrl: https://api.shinyapps.io/v1
appId: 13276335
bundleId: 9334284
bundleId: 9334579
url: https://agdamsbo.shinyapps.io/webResearch/
version: 1

View file

@ -1,5 +1,23 @@
# project.aid::merge_scripts(list.files("R/",full.names = TRUE),dest = here::here("app/functions.R"))
source(here::here("app/functions.R"))
# source(here::here("functions.R"))
source("https://raw.githubusercongittent.com/agdamsbo/webResearch/refs/heads/main/app/functions.R")
library(readr)
library(MASS)
library(stats)
library(gt)
library(gtsummary)
library(openxlsx2)
library(haven)
library(readODS)
library(shiny)
library(bslib)
library(assertthat)
library(dplyr)
library(quarto)
library(here)
server <- function(input, output, session) {
v <- shiny::reactiveValues(
@ -108,7 +126,7 @@ server <- function(input, output, session) {
output$report <- downloadHandler(
filename = "analyses.html",
content = function(file) {
v$list |> write_quarto(file = file)
v$list |> write_quarto(file = file,qmd.file = "www/analyses.qmd")
}
)

View file

@ -104,16 +104,16 @@ ui <- bslib::page_sidebar(
),
actionButton("load", "Analyse", class = "btn-primary")
)
# ,
,
# Horizontal line ----
# tags$hr(),
# h4("Download results"),
#
# # Button
# downloadButton(outputId="report",
# label= "Download",
# icon = shiny::icon("download"))
# Horizontal line ----
tags$hr(),
h4("Download results"),
# Button
downloadButton(outputId="report",
label= "Download",
icon = shiny::icon("download"))
),
layout_columns(
cards[[1]]

39
app/www/analyses.qmd Normal file
View file

@ -0,0 +1,39 @@
---
title: "webResearch analysis results"
date: today
execute:
echo: false
params:
data.file: NA
---
```{r setup}
web_data <- readRDS(file = params$data.file)
```
## Introduction
## Methods
Analyses were conducted in R version `r paste(version["major"],version["minor"],sep=".")` using the web-based data analysis tool 'webResearcher' version `r packageVersion("webResearch")`.
## Results
Below is the baseline characteristics plotted.
```{r}
web_data$table1
```
Here are the regression results.
```{r}
web_data$table2
```
## Discussion
Good luck on your further work!