Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/openpharma/visR into 310…
Browse files Browse the repository at this point in the history
…update
  • Loading branch information
ddsjoberg committed Feb 25, 2022
2 parents dd0ed28 + 3c9c2c1 commit 6a94b2b
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 35 deletions.
53 changes: 37 additions & 16 deletions R/tableone.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@
#' Pre-implemented functions are summarize_long and summarize_short
#' @param ... Pass options to render_table
#'
#' @section Example Output:
#' \if{html}{tableone(engine = "gt")}
#'
#' \if{html}{\figure{tableone_gt_ex.png}{options: width=65\%}}
#'
#' \if{html}{tableone(engine = "DT")}
#'
#' \if{html}{\figure{tableone_DT_ex.png}{options: width=65\%}}
#'
#' \if{html}{tableone(engine = "kable")}
#'
#' \if{html}{\figure{tableone_kable_html_ex.png}{options: width=65\%}}
#'
#' \if{html}{tableone(engine = "kable", output_format = "latex")}
#'
#' \if{html}{\figure{tableone_kable_latex_ex.png}{options: width=65\%}}
#'
#' @examples
#'
#' # metadata for table
Expand All @@ -25,8 +42,23 @@
#' t1_fn <- "My table one footnote"
#'
#'
#' ## table by treatment - without overall and render with GT
#' tbl_gt <-
#' adtte %>%
#' dplyr::filter(SAFFL == "Y") %>%
#' dplyr::select(AGE, AGEGR1, SEX, EVNTDESC, TRTA) %>%
#' visR::tableone(
#' strata = "TRTA",
#' overall = FALSE,
#' title = t1_title,
#' datasource = t1_ds,
#' footnote = t1_fn,
#' engine = "gt"
#' )
#'
#' ## table by treatment - without overall and render with DT
#' adtte %>%
#' tbl_DT <-
#' adtte %>%
#' dplyr::filter(SAFFL == "Y") %>%
#' dplyr::select(AGE, AGEGR1, SEX, EVNTDESC, TRTA) %>%
#' visR::tableone(
Expand All @@ -38,21 +70,9 @@
#' engine = "DT"
#' )
#'
#' ## table by treatment - without overall and render with GT
#' adtte %>%
#' dplyr::filter(SAFFL == "Y") %>%
#' dplyr::select(AGE, AGEGR1, SEX, EVNTDESC, TRTA) %>%
#' visR::tableone(
#' strata = "TRTA",
#' overall = FALSE,
#' title = t1_title,
#' datasource = t1_ds,
#' footnote = t1_fn,
#' engine = "gt"
#' )
#'
#' ## table by treatment - without overall and render with kable
#' adtte %>%
#' tbl_kable_html <-
#' adtte %>%
#' dplyr::filter(SAFFL == "Y") %>%
#' dplyr::select(AGE, AGEGR1, SEX, EVNTDESC, TRTA) %>%
#' visR::tableone(
Expand All @@ -66,7 +86,8 @@
#'
#' ## table by treatment - without overall and render with kable as
#' ## a latex table format rather than html
#' adtte %>%
#' tbl_kable_latex <-
#' adtte %>%
#' dplyr::filter(SAFFL == "Y") %>%
#' dplyr::select(AGE, AGEGR1, SEX, EVNTDESC, TRTA) %>%
#' visR::tableone(
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ current focus on developing a stable API.
| [![R-CMD-check](https://github.com/openpharma/visR/actions/workflows/check-standard.yaml/badge.svg?branch=main)](https://github.com/openpharma/visR/actions/workflows/check-standard.yaml) | `main` branch |
| [![pkgdown](https://github.com/openpharma/visR/actions/workflows/makedocs.yml/badge.svg)](https://github.com/openpharma/visR/actions/workflows/makedocs.yml) | Documentation building to [Github pages](https://openpharma.github.io/visR/) |
| [![CRAN status](https://www.r-pkg.org/badges/version/visR)](https://CRAN.R-project.org/package=visR) | Latest CRAN release |
| <a href=https://github.com/pharmaR/riskmetric><img src=https://img.shields.io/badge/riskmetric--1.06-green></img></a> | `riskmetric` score |
| <a href=https://github.com/pharmaR/riskmetric><img src=https://img.shields.io/badge/riskmetric--1.53-green></img></a> | `riskmetric` score |

<!-- badges: end -->

Expand Down Expand Up @@ -117,7 +117,8 @@ covr::package_coverage(
code = "tools::testInstalledPackage(pkg = 'visR', types = c('tests'))",
quiet = FALSE
)
#> visR Coverage: 99.88%
#> visR Coverage: 99.64%
#> R/estimate_cuminc.R: 85.71%
#> R/visr.R: 99.12%
#> R/add_annotation.R: 100.00%
#> R/add_CI.R: 100.00%
Expand All @@ -127,7 +128,6 @@ covr::package_coverage(
#> R/add_risktable.R: 100.00%
#> R/apply_attrition.R: 100.00%
#> R/apply_theme.R: 100.00%
#> R/estimate_cuminc.R: 100.00%
#> R/estimate_KM.R: 100.00%
#> R/get_attrition.R: 100.00%
#> R/get_COX_HR.R: 100.00%
Expand Down
Binary file added man/figures/tableone_DT_ex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/tableone_gt_ex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/tableone_kable_html_ex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/tableone_kable_latex_ex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 39 additions & 16 deletions man/tableone.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6a94b2b

Please sign in to comment.