diff --git a/DESCRIPTION b/DESCRIPTION
index 88cef23a..12a3314e 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Type: Package
Package: visR
Title: Clinical Graphs and Tables Adhering to Graphical Principles
-Version: 0.2.0.9001
+Version: 0.2.0.9002
Authors@R: c(
person(given = "Mark",
family = "Baillie",
diff --git a/NEWS.md b/NEWS.md
index 56db238a..1d7fb3e5 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -13,6 +13,8 @@
* Improved documentation for `visr()` and other generic functions. (#301)
+* The `README` page has been updated with additional examples. ()
+
# visR 0.2.0
* Initial CRAN release.
diff --git a/README.Rmd b/README.Rmd
index 9f9fbdb2..276d2fcc 100644
--- a/README.Rmd
+++ b/README.Rmd
@@ -82,9 +82,11 @@ Install the *latest stable* version from [GitHub](https://github.com/) with:
devtools::install_github("openpharma/visR", ref = "main")
```
-## Example
+## Examples
-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,25 @@ adtte %>%
)
```
+
+#### Summary Table
+
+The `tableone()` function presents summary statistics in a table format.
+
+```{r table, warning=FALSE, message = FALSE}
+## 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 +138,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)"))`
diff --git a/README.md b/README.md
index 7bd9b63b..0d9cba27 100644
--- a/README.md
+++ b/README.md
@@ -70,13 +70,15 @@ with:
devtools::install_github("openpharma/visR", ref = "main")
```
-## Example
+## Examples
+
+#### 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,519 @@ adtte %>%
+#### Summary Table
+
+The `tableone()` function presents summary statistics in a table format.
+
+``` r
+## 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-max | +51-89 | +52-89 | +56-88 | +51-88 |
Missing | +0 (0%) | +0 (0%) | +0 (0%) | +0 (0%) |
SEX | +||||
F | +143 (56.3%) | +53 (61.6%) | +40 (47.6%) | +50 (59.5%) |
M | +111 (43.7%) | +33 (38.4%) | +44 (52.4%) | +34 (40.5%) |
TRTA | +||||
Placebo | +86 (33.9%) | +NA | +NA | +NA |
Xanomeline High Dose | +84 (33.1%) | +NA | +NA | +NA |
Xanomeline Low Dose | +84 (33.1%) | +NA | +NA | +NA |
Data Source: ADaM Interim Dataset for Time-to-Event Analysis | +||||
+ |