From cb15774e3e77007228a2275c941cf010fea30512 Mon Sep 17 00:00:00 2001 From: ardeeshany Date: Sat, 7 May 2022 19:39:49 -0400 Subject: [PATCH 1/9] Update README.Rmd by tableone --- README.Rmd | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/README.Rmd b/README.Rmd index 9f9fbdb2..5dd3b9f1 100644 --- a/README.Rmd +++ b/README.Rmd @@ -84,7 +84,9 @@ devtools::install_github("openpharma/visR", ref = "main") ## Example -This is a basic example to demonstrate how the API can be used to add layers to a visualization. In this example a time to event analysis. The example calculates stratified Kaplan-Meier by treatment and then plots. Additional functions can be used to add uncertainty intervals, censoring information and a risk table. +### Visualization + +This is a basic example to demonstrate how the API can be used to add layers to a visualization. This example demonstrates a time-to-event analysis. The example calculates and then plots stratified Kaplan-Meier by treatment. It is possible to add uncertainty intervals, censoring information, and a risk table using additional functions. ```{r example, warning=FALSE, message = FALSE} library(visR) @@ -103,6 +105,30 @@ adtte %>% ) ``` + +### Summary Table + +The `tableone` calculates and presents summary statistics in a table format. There are a few more customization options available, such as footnote and summary functions. + +```{r table, warning=FALSE, message = FALSE} +library(visR) +library(ggplot2) + +theme_set(theme_minimal()) + +## table by treatment - without overall and render with GT +adtte %>% + dplyr::select(AGE, SEX, TRTA) %>% + visR::tableone( + strata = "TRTA", + overall = TRUE, + title = "Cohort Summary", + datasource = "ADaM Interim Dataset for Time-to-Event Analysis", + engine = "gt" + ) +``` + + ## Cite visR ```{text, comment="", eval = FALSE} @@ -117,4 +143,4 @@ Thank you to all contributors: ```{r warning=FALSE, echo=FALSE, message=FALSE} contr <- usethis::use_tidy_thanks("https://github.com/openpharma/visR") ``` -`r unique(c(paste((paste0("[@",contr,"](https://github.com/", contr, ")")), collapse = ", "), "[@cschaerfe ](https://github.com/cschaerfe)", "[@AlexandraP-21 ](https://github.com/AlexandraP-21)"))` \ No newline at end of file +`r unique(c(paste((paste0("[@",contr,"](https://github.com/", contr, ")")), collapse = ", "), "[@cschaerfe ](https://github.com/cschaerfe)", "[@AlexandraP-21 ](https://github.com/AlexandraP-21)"))` From eba66294eb535004b8e65ac512f59a05e09bdd2c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 7 May 2022 23:47:12 +0000 Subject: [PATCH 2/9] Re-build README.Rmd --- README.md | 532 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 527 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a6342262..87cd948c 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ coverage](https://codecov.io/gh/openpharma/visR/branch/develop/graph/badge.svg)] [![pkgdown](https://github.com/openpharma/visR/actions/workflows/makedocs.yml/badge.svg)](https://github.com/openpharma/visR/actions/workflows/makedocs.yml) [![CRAN status](https://www.r-pkg.org/badges/version/visR)](https://CRAN.R-project.org/package=visR) - + ## Installation @@ -72,11 +72,13 @@ devtools::install_github("openpharma/visR", ref = "main") ## Example +### Visualization + This is a basic example to demonstrate how the API can be used to add -layers to a visualization. In this example a time to event analysis. The -example calculates stratified Kaplan-Meier by treatment and then plots. -Additional functions can be used to add uncertainty intervals, censoring -information and a risk table. +layers to a visualization. This example demonstrates a time-to-event +analysis. The example calculates and then plots stratified Kaplan-Meier +by treatment. It is possible to add uncertainty intervals, censoring +information, and a risk table using additional functions. ``` r library(visR) @@ -97,6 +99,526 @@ adtte %>% +### Summary Table + +The `tableone` calculates and presents summary statistics in a table +format. There are a few more customization options available, such as +footnote and summary functions. + +``` r +library(visR) +library(ggplot2) + +theme_set(theme_minimal()) + +## table by treatment - without overall and render with GT +adtte %>% + dplyr::select(AGE, SEX, TRTA) %>% + visR::tableone( + strata = "TRTA", + overall = TRUE, + title = "Cohort Summary", + datasource = "ADaM Interim Dataset for Time-to-Event Analysis", + engine = "gt" + ) +``` + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Cohort Summary
Total (N=254)Placebo (N=86)Xanomeline High Dose (N=84)Xanomeline Low Dose (N=84)
AGE
Mean (SD)75.1 (8.25)75.2 (8.59)74.4 (7.89)75.7 (8.29)
Median (IQR)77 (70-81)76 (69.2-81.8)76 (70.8-80)77.5 (71-82)
Min-max51-8952-8956-8851-88
Missing0 (0%)0 (0%)0 (0%)0 (0%)
SEX
F143 (56.3%)53 (61.6%)40 (47.6%)50 (59.5%)
M111 (43.7%)33 (38.4%)44 (52.4%)34 (40.5%)
TRTA
Placebo86 (33.9%)NANANA
Xanomeline High Dose84 (33.1%)NANANA
Xanomeline Low Dose84 (33.1%)NANANA
Data Source: ADaM Interim Dataset for Time-to-Event Analysis
+
+ ## Cite visR ``` text From 17c48b169fdf18a9bd1564fc444ea9f8d4bf0fb4 Mon Sep 17 00:00:00 2001 From: Daniel Sjoberg Date: Sat, 7 May 2022 20:07:24 -0400 Subject: [PATCH 3/9] installing and rendering readme --- README.md | 97 +++++++++++++++---------------- man/figures/README-example-1.png | Bin 12785 -> 12977 bytes 2 files changed, 48 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 87cd948c..d1b21bf8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ - # visR @@ -18,9 +17,9 @@ By using a common package for visualising data analysis results in the clinical development process, we want to have a **positive influence** on - - **choice of visualisation** by making it easy explore different +- **choice of visualisation** by making it easy explore different visualisation and to use impactful visualisations fit-for-purpose - - effective visual communication by making it easy to **implement best +- effective visual communication by making it easy to **implement best practices** We are not judging on what visualisation you chose for your research @@ -44,7 +43,7 @@ coverage](https://codecov.io/gh/openpharma/visR/branch/develop/graph/badge.svg)] [![pkgdown](https://github.com/openpharma/visR/actions/workflows/makedocs.yml/badge.svg)](https://github.com/openpharma/visR/actions/workflows/makedocs.yml) [![CRAN status](https://www.r-pkg.org/badges/version/visR)](https://CRAN.R-project.org/package=visR) - + ## Installation @@ -123,12 +122,12 @@ adtte %>% ) ``` -
+