abandoned quarto to render report using rmarkdown instead. works smoothly!

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-01-23 13:21:41 +01:00
commit d51fd27996
No known key found for this signature in database
7 changed files with 165 additions and 55 deletions

View file

@ -13,34 +13,17 @@ params:
```{r}
#| message: false
#| warning: false
# if (!requireNamespace("gtsummary")){
# install.packages("gtsummary")
# } else {
# library(gtsummary)
# }
#
# if (!requireNamespace("gt")){
# install.packages("gt")
# } else {
# library(gt)
# }
#
# if (!requireNamespace("readr")){
# install.packages("readr")
# } else {
# library(readr)
# }
# requireNamespace("gtsummary")
# requireNamespace("gt")
# require(gt)
# require(flextable)
# if (!requireNamespace("readr")){
# install.packages("readr")
# }
web_data <- readr::read_rds(file = params$data.file)
# library(gt)
# library(flextable)
# library(freesearcheR)
library(gtsummary)
library(gt)
tbl_merge <- function(data) {
if (is.null(names(data))) {
data |> gtsummary::tbl_merge()
} else {
data |> gtsummary::tbl_merge(tab_spanner = names(data))
}
}
```
## Introduction
@ -55,13 +38,16 @@ Analyses were conducted in the *freesearcheR* data analysis web-tool based on R
Below are the baseline characteristics.
{{< include _table1.md >}}
```{r, results = 'asis'}
tbl <- gtsummary::as_gt(web_data$table1)
knitr::knit_print(tbl)
```
Below are results from the univariable and multivariable regression analyses.
Below are the results from the
```{r}
gtsummary::tbl_summary(mtcars,by=cyl)
```{r, results = 'asis'}
reg_tbl <- web_data$regression$tables
knitr::knit_print(tbl_merge(reg_tbl))
```
## Discussion

View file

@ -0,0 +1,56 @@
---
title: "freesearcheR analysis results"
date: today
format: docx
author: freesearcheR Tool
toc: false
params:
data.file: NA
---
```{r setup, echo = FALSE}
knitr::opts_chunk$set(echo = FALSE, message=FALSE, warning=FALSE)
```
```{r}
web_data <- readr::read_rds(file = params$data.file)
library(gtsummary)
library(gt)
tbl_merge <- function(data) {
if (is.null(names(data))) {
data |> gtsummary::tbl_merge()
} else {
data |> gtsummary::tbl_merge(tab_spanner = names(data))
}
}
```
## Introduction
Research should be free and open with easy access for all. The freesearcheR tool attempts to help lower the bar to participate in contributing to science by making guided data analysis easily accessible in the web-browser.
## Methods
Analyses were conducted in the *freesearcheR* data analysis web-tool based on R version 4.4.1.
## Results
Below are the baseline characteristics.
```{r, results = 'asis'}
tbl <- gtsummary::as_gt(web_data$table1)
knitr::knit_print(tbl)
```
Below are the results from the
```{r, results = 'asis'}
reg_tbl <- web_data$regression$tables
knitr::knit_print(tbl_merge(reg_tbl))
```
## Discussion
Good luck on your further work!