Skip to content

Commit

Permalink
prepping for release
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg committed Sep 5, 2024
1 parent f6e0529 commit 8dba09e
Show file tree
Hide file tree
Showing 56 changed files with 91 additions and 22 deletions.
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 2.0.2
Date: 2024-09-05 14:14:07 UTC
SHA: f6e052973a1ae3b8b5c7957ccf8c3290636656d2
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: gtsummary
Title: Presentation-Ready Data Summary and Analytic Result Tables
Version: 2.0.1.9013
Version: 2.0.2
Authors@R: c(
person("Daniel D.", "Sjoberg", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-0862-2018")),
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gtsummary (development version)
# gtsummary 2.0.2

Updates to address regressions in the v2.0.0 release:

Expand All @@ -10,6 +10,8 @@ Updates to address regressions in the v2.0.0 release:

### Other updates

* The Themes and Inline Text vignettes have been converted to articles (that is, they are no longer bundled with the package, but are still available on the website).

* The total N is now returned with `.$cards` using the `cards::ard_total_n()` function for the calculation.

* The default headers for `tbl_ard_*()` functions no longer include counts, as these are not required data to be passed along in the ARD input.
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_difference.tbl_summary.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c(
"broom", "broom.helpers", "lme4", "smd",
"effectsize", "emmeans"
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_difference.tbl_svysummary.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("survey", "cardx"), reference_pkg = "gtsummary"))

svy_titanic <- survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_glance.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("broom.helpers", "cardx"), reference_pkg = "gtsummary"))

# add_glance_source_note() -----------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_global_p.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
test_that("add_global_p() works", {
expect_error(
lm(age ~ trt, trial) |>
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-add_n.tbl_regression.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

test_that("add_n.tbl_regression() works", {
tbl <-
glm(response ~ grade + age, trial, family = binomial) %>%
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-add_n.tbl_summary.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

test_that("add_n.tbl_summary() works", {
# with stratifying variable
expect_error(
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-add_n.tbl_survfit.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

test_that("add_n.tbl_survfit() works", {
# add_n.tbl_survfit works
fit1 <- survival::survfit(survival::Surv(ttdeath, death) ~ 1, trial)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_n.tbl_svysummary.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed("survey", reference_pkg = "gtsummary"))

svy_trial <- survey::svydesign(~1, data = trial, weights = ~1)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_n.tbl_uvregression.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("broom.helpers", "broom"), reference_pkg = "gtsummary"))

test_that("add_n.tbl_uvregression() works", {
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_nevent.tbl_regression.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
test_that("add_nevent.tbl_regression() works", {
tbl <-
glm(response ~ grade + age, trial, family = binomial) %>%
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-add_nevent.tbl_survfit.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

test_that("add_nevent.tbl_survfit() works", {
tbl <- trial |>
tbl_survfit(
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_nevent.tbl_uvregression.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("broom.helpers", "broom"), reference_pkg = "gtsummary"))

test_that("add_nevent.tbl_uvregression() works", {
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_overall.tbl_continuous.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
test_that("add_overall.tbl_continuous() works", {
# typical usage works
expect_error(
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_overall.tbl_svysummary.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed("survey", reference_pkg = "gtsummary"))

svy_mtcars <- survey::svydesign(~1, data = mtcars, weights = ~1)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_p.tbl_continuous.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed("cardx", reference_pkg = "gtsummary"))

test_that("add_p.tbl_continuous() works", {
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-add_p.tbl_cross.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
skip_on_cran()
skip_if_not(is_pkg_installed("cardx", reference_pkg = "gtsummary"))

test_that("add_p.tbl_cross() works", {
expect_silent(
out <- trial |>
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_p.tbl_summary.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("broom", "lme4", "broom.helpers"), reference_pkg = "cardx"))

test_that("add_p.tbl_summary() snapshots of common outputs", {
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-add_p.tbl_survfit.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("cardx", "survival"), reference_pkg = "cardx"))

test_that("add_p.tbl_survfit() works", {
tbl <- trial |>
tbl_survfit(
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-add_q.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

test_that("add_q() works after add_p()", {
table1 <- trial %>%
tbl_summary(by = trt) %>%
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_stat.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed("cardx", reference_pkg = "gtsummary"))

my_ttest <- function(data, variable, by, ...) {
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-add_stat_label.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

test_that("add_stat_label(location='row') standard use", {
tbl <- trial |> tbl_summary(by = trt)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_stat_label.tbl_svysummary.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed("survey", reference_pkg = "gtsummary"))

svy_trial <- survey::svydesign(~1, data = trial, weights = ~1)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_vif.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("car", "broom.helpers", "cardx"), reference_pkg = "gtsummary"))

test_that("add_vif(x)", {
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-bold_italicize_labels_levels.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
tbl <- tbl_summary(trial, include = age)

test_that("bold_labels() works", {
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-bold_p.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
skip_on_cran()
skip_if_not(is_pkg_installed("cardx", reference_pkg = "gtsummary"))

test_that("bold_p() works", {
expect_equal(
trial |>
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-custom_tidiers.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("broom.helpers", "cardx"), reference_pkg = "gtsummary"))

test_that("tidy_standardize()", {
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-gather_ard.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed("cardx", reference_pkg = "gtsummary"))

test_that("gather_ard(x) works with `tbl_*()` functions", {
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-inline_text.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
skip_if_not(broom.helpers::.assert_package("survival", pkg_search = "gtsummary", boolean = TRUE))
skip_on_cran()
skip_if_not(is_pkg_installed("survival", reference_pkg = "gtsummary"))

# inline_text.tbl_summary tests ------------------------------------------------
test_inline1 <- trial |> tbl_summary()
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-label_style.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed("withr", reference_pkg = "gtsummary"))

test_that("label_style_*()", {
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-modify_caption.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

test_that("modify_caption(caption) works", {
expect_equal(
tbl_summary(trial, include = marker) |>
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-modify_column_alignment.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

test_that("modify_column_alignment() works", {
tbl <-
lm(age ~ marker + grade, trial) |>
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-modify_column_hide.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

test_that("modify_column_hide() works", {
expect_snapshot(
lm(age ~ marker + grade, trial) |>
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-modify_column_indent.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

# begin with deprecation messaging
test_that("modify_column_indent() deprecations", {
lifecycle::expect_deprecated(
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-modify_column_merge.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("broom.helpers", "cardx"), reference_pkg = "gtsummary"))

mod <- lm(marker ~ age + grade, trial) |> tbl_regression()

test_that("modify_column_merge() works", {
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-modify_fmt_fun.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("broom.helpers", "cardx"), reference_pkg = "gtsummary"))

test_that("modify_fmt_fun() works", {
expect_error(
tbl <- lm(age ~ marker + grade, trial) |>
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-modify_footnote.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()

# first, testing deprecation
test_that("modify_footnote(update,quiet) are deprecated", {
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-modify_header.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()

# first, testing deprecation
test_that("modify_header(update,quiet) are deprecated", {
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-modify_spanning_header.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()

# first, testing deprecation
test_that("modify_spanning_header(update,quiet) are deprecated", {
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-modify_table_body.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

test_that("modify_table_body() works", {
expect_snapshot(
glm(response ~ trt + marker, trial, family = binomial) |>
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-modify_table_styling.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

# starting with checks of the deprecation
test_that("modify_table_styling(undo_text_format=logical()) deprecation", {
withr::local_options(lifecycle_verbosity = "quiet")
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-plot.tbl_regression.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("ggstats", "broom.helpers"), reference_pkg = "gtsummary"))

test_that("plot.tbl_regression() works", {
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-plot.tbl_uvregression.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("ggstats", "broom.helpers"), reference_pkg = "gtsummary"))

test_that("plot.tbl_uvregression() works", {
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-remove_row_type.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("cardx", "broom.helpers"), reference_pkg = "gtsummary"))

test_that("remove_row_type(type) works", {
tbl1 <- tbl_summary(trial, include = c(response, age, grade))
tbl2 <- lm(age ~ grade + response, trial) |> tbl_regression()
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-scoping_gtsummary.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

test_that("scope_header()", {
tbl <- trial |>
tbl_summary(by = trt, include = age, missing = "no")
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-select_helpers.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

test_that("select_helpers work", {
tbl_sum <- trial |> tbl_summary(type = age ~ "continuous2")
tbl_reg <-
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-separate_p_footnotes.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
skip_if_not(is_pkg_installed("cardx", reference_pkg = "gtsummary"))
skip_if_not(is_pkg_installed("broom", reference_pkg = "cardx"))
skip_on_cran()
skip_if_not(is_pkg_installed(c("cardx", "broom"), reference_pkg = "gtsummary"))

test_that("separate_p_footnotes()", {
tbl <- trial |>
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-show_header_names.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("cardx", "broom.helpers"), reference_pkg = "gtsummary"))

test_that("show_header_names() works with tbl_summary()", {
expect_snapshot(
tbl_summary(trial, include = age, by = trt, missing = "no") |>
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-sort_filter_p.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("cardx", "broom"), reference_pkg = "gtsummary"))

test_that("sort_p() works", {
# check the variables sort to the correct order
expect_equal(
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-tbl_likert.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_cran()
skip_if_not(is_pkg_installed("withr", reference_pkg = "gtsummary"))

levels <- c("Strongly Disagree", "Disagree", "Agree", "Strongly Agree")
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test-tbl_regression_methods.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
skip_on_cran()
skip_if_not(is_pkg_installed(c("broom.helpers", "withr"), reference_pkg = "gtsummary"))


test_that("tbl_regression.model_fit()", {
skip_if_not(is_pkg_installed("parsnip", reference_pkg = "gtsummary"))

Expand Down Expand Up @@ -79,7 +79,6 @@ test_that("tbl_regression.gam()", {
)
})


test_that("tbl_regression.crr()", {
skip_if_not(is_pkg_installed("cmprsk", reference_pkg = "gtsummary"))
withr::local_package("cmprsk")
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-tbl_split.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip_on_cran()

test_that("tbl_split()", {
expect_silent(
tbl <- tbl_summary(trial) |>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
---
title: "inline_text() tutorial"
date: "Last Updated: September 13, 2020"
output: rmarkdown::html_vignette
vignette: >
%\VignetteEncoding{UTF-8}
%\VignetteIndexEntry{Tutorial: inline_text}
%\VignetteEngine{knitr::rmarkdown}
chunk_output_type: console
---

```{r, include = FALSE}
Expand Down
8 changes: 0 additions & 8 deletions vignettes/themes.Rmd → vignettes/articles/themes.Rmd
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
---
title: "gtsummary themes"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{gtsummary themes}
%\VignetteEncoding{UTF-8}
%\VignetteEngine{knitr::rmarkdown}
editor_options:
chunk_output_type: console
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
warning = FALSE,
comment = "#>"
)
```
Expand Down

0 comments on commit 8dba09e

Please sign in to comment.