mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 12:37:30 +02:00
abandoned quarto to render report using rmarkdown instead. works smoothly!
This commit is contained in:
parent
159750fa62
commit
d51fd27996
7 changed files with 165 additions and 55 deletions
|
|
@ -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
|
||||
|
|
|
|||
56
inst/apps/data_analysis_modules/www/report.rmd
Normal file
56
inst/apps/data_analysis_modules/www/report.rmd
Normal 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!
|
||||
Loading…
Add table
Add a link
Reference in a new issue