-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from agdamsbo/report
Report export solved
- Loading branch information
Showing
7 changed files
with
187 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
inst/apps/data_analysis_modules/rsconnect/shinyapps.io/cognitiveindex/freesearcheR_dev.dcf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: freesearcheR_dev | ||
title: | ||
username: cognitiveindex | ||
account: cognitiveindex | ||
server: shinyapps.io | ||
hostUrl: https://api.shinyapps.io/v1 | ||
appId: 13786206 | ||
bundleId: 9688582 | ||
url: https://cognitiveindex.shinyapps.io/freesearcheR_dev/ | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
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)) | ||
} | ||
} | ||
vec2sentence <- function(data, sep.word = "and") { | ||
sep.word <- paste0(" ", gsub(" ", "", sep.word), " ") | ||
if (length(data) < 2) { | ||
out <- data | ||
} else if (length(data) == 2) { | ||
out <- paste(data, collapse = sep.word) | ||
} else { | ||
out <- paste(paste(data[-length(data)], collapse = ","), data[length(data)], sep = sep.word) | ||
} | ||
return(out) | ||
} | ||
``` | ||
|
||
## 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 tolower(vec2sentence(names(web_data$regression$tables)))` `r web_data$regression$params$descr`. | ||
|
||
```{r, results = 'asis'} | ||
reg_tbl <- web_data$regression$tables | ||
knitr::knit_print(tbl_merge(reg_tbl)) | ||
``` | ||
|
||
## Discussion | ||
|
||
Good luck on your further work! |