Skip to content

Commit

Permalink
final updates before CRAN
Browse files Browse the repository at this point in the history
* test updates

* skipping some tests on CRAN

* skpiping tests on CRAN

* vignette updates

* Increment version number

* doc updates

* clearing cache

* Update cran-comments.md
  • Loading branch information
ddsjoberg authored Jun 2, 2020
1 parent a89033f commit e15ff6f
Show file tree
Hide file tree
Showing 85 changed files with 83 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ jobs:
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-1-
key: ${{ runner.os }}-r-${{ matrix.config.r }}-2-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-2-

- name: Install system dependencies
if: runner.os == 'Linux'
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: gtsummary
Title: Presentation-Ready Data Summary and Analytic Result
Tables
Version: 1.3.0.9019
Version: 1.3.1
Authors@R:
c(person(given = "Daniel D.",
family = "Sjoberg",
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gtsummary (development version)
# gtsummary 1.3.1

### New Functions

Expand Down
30 changes: 15 additions & 15 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
"codeRepository": "https://github.com/ddsjoberg/gtsummary",
"issueTracker": "https://github.com/ddsjoberg/gtsummary/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "1.3.0.9014",
"version": "1.3.1",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"version": "3.6.1",
"version": "4.0.0",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 3.6.1 (2019-07-05)",
"runtimePlatform": "R version 4.0.0 (2020-04-24)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -256,7 +256,7 @@
"@type": "SoftwareApplication",
"identifier": "broom",
"name": "broom",
"version": ">= 0.5.5",
"version": ">= 0.5.6",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand All @@ -269,7 +269,7 @@
"@type": "SoftwareApplication",
"identifier": "broom.mixed",
"name": "broom.mixed",
"version": ">= 0.2.4",
"version": ">= 0.2.6",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -334,7 +334,7 @@
"@type": "SoftwareApplication",
"identifier": "gt",
"name": "gt",
"version": ">= 0.2.0.5",
"version": ">= 0.2.1",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -399,7 +399,7 @@
"@type": "SoftwareApplication",
"identifier": "purrr",
"name": "purrr",
"version": ">= 0.3.3",
"version": ">= 0.3.4",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand All @@ -412,7 +412,7 @@
"@type": "SoftwareApplication",
"identifier": "rlang",
"name": "rlang",
"version": ">= 0.4.5",
"version": ">= 0.4.6",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -450,7 +450,7 @@
"@type": "SoftwareApplication",
"identifier": "tibble",
"name": "tibble",
"version": ">= 3.0.0",
"version": ">= 3.0.1",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand All @@ -463,7 +463,7 @@
"@type": "SoftwareApplication",
"identifier": "tidyr",
"name": "tidyr",
"version": ">= 1.0.2",
"version": ">= 1.0.3",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand All @@ -476,7 +476,7 @@
"@type": "SoftwareApplication",
"identifier": "tidyselect",
"name": "tidyselect",
"version": ">= 1.0.0",
"version": ">= 1.1.0",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand All @@ -489,7 +489,7 @@
"@type": "SoftwareApplication",
"identifier": "usethis",
"name": "usethis",
"version": ">= 1.5.1",
"version": ">= 1.6.1",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand All @@ -499,9 +499,9 @@
"sameAs": "https://CRAN.R-project.org/package=usethis"
}
],
"releaseNotes": "https://github.com/ddsjoberg/gtsummary/blob/master/NEWS.md",
"readme": "https://github.com/ddsjoberg/gtsummary/blob/master/README.md",
"fileSize": "2944.833KB",
"releaseNotes": "https://github.com/oranwutang/gtsummary/blob/master/NEWS.md",
"readme": "https://github.com/oranwutang/gtsummary/blob/master/README.md",
"fileSize": "3100.021KB",
"contIntegration": [
"https://travis-ci.org/ddsjoberg/gtsummary",
"https://ci.appveyor.com/project/ddsjoberg/gtsummary",
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Test environments
* Windows 10 (local), R 3.6.3
* Windows 10 (local), 3.6, 4.0
* Ubuntu 16.04.6 LTS (on github actions), 3.4, 3.5, 3.6, 4.0
* Windows Server 2019 (on github actions), 4.0
* macOS (on github actions), 4.0, devel
Expand Down
Binary file modified man/figures/add_nevent_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 modified man/figures/add_p_cross_ex1.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 modified man/figures/add_p_cross_ex2.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 modified man/figures/add_p_ex1.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 modified man/figures/add_p_ex2.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 modified man/figures/add_q_ex1.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 modified man/figures/add_q_ex2.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 modified man/figures/add_stat_ex1.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 modified man/figures/add_stat_ex2.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 modified man/figures/add_stat_label_ex1.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 modified man/figures/add_stat_label_ex2.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 modified man/figures/as_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 modified man/figures/bold_p_ex1.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 modified man/figures/bold_p_ex2.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 modified man/figures/combine_terms_ex1.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 modified man/figures/combine_terms_ex2.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 modified man/figures/combine_terms_ex3.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 modified man/figures/inline_text_ex1.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 modified man/figures/modify_footnote_ex1.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 modified man/figures/modify_footnote_ex2.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 modified man/figures/modify_footnote_ex3.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 modified man/figures/modify_header_ex1.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 modified man/figures/modify_header_ex2.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 modified man/figures/select_ex1.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 modified man/figures/set_gtsummary_theme_ex1.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 modified man/figures/sort_p_ex1.png
Binary file modified man/figures/sort_p_ex2.png
Binary file modified man/figures/spanning_header_ex1.png
Binary file modified man/figures/tbl_bold_ital_ex.png
Binary file modified man/figures/tbl_cross_ex1.png
Binary file modified man/figures/tbl_cross_ex2.png
Binary file modified man/figures/tbl_lm_global_ex1.png
Binary file modified man/figures/tbl_merge_ex1.png
Binary file modified man/figures/tbl_merge_ex2.png
Binary file modified man/figures/tbl_n_ex.png
Binary file modified man/figures/tbl_nostrata_ex2.png
Binary file modified man/figures/tbl_overall_ex.png
Binary file modified man/figures/tbl_regression_ex1.png
Binary file modified man/figures/tbl_regression_ex2.png
Binary file modified man/figures/tbl_regression_ex3.png
Binary file modified man/figures/tbl_stack_ex1.png
Binary file modified man/figures/tbl_stack_ex2.png
Binary file modified man/figures/tbl_strata_ex1.png
Binary file modified man/figures/tbl_summary_ex1.png
Binary file modified man/figures/tbl_summary_ex2.png
Binary file modified man/figures/tbl_summary_ex3.png
Binary file modified man/figures/tbl_survfit_ex1.png
Binary file modified man/figures/tbl_survfit_ex2.png
Binary file modified man/figures/tbl_uv_ex1.png
Binary file modified man/figures/tbl_uv_ex2.png
Binary file modified man/figures/tbl_uv_global_ex2.png
Binary file modified man/figures/tbl_uv_nevent_ex.png
1 change: 1 addition & 0 deletions tests/testthat/test-add_global_p.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("test-add_global_p")
testthat::skip_on_cran()

test_that("no errors/warnings with standard use after tbl_regression", {
mod1 <- lm(hp ~ factor(cyl) + mpg + factor(am), mtcars) %>% tbl_regression()
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_n.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("test-add_n")
testthat::skip_on_cran()

t1 <- trial %>% tbl_summary()
t2 <- trial %>% tbl_summary(by = trt)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_nevent.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("test-add_nevent")
testthat::skip_on_cran()

library(survival)
fit_cox <- coxph(Surv(time, status) ~ sex, lung)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-add_overall.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("test-add_overall")
testthat::skip_on_cran()
library(survival)

test_that("no errors/warnings with standard use", {
Expand All @@ -22,5 +23,4 @@ test_that("no errors/warnings with missing data", {

test_that("no errors/warnings with missing data in by variable", {
expect_error(trial %>% tbl_summary(by = response) %>% add_overall(), NA)

})
1 change: 1 addition & 0 deletions tests/testthat/test-add_p.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("test-add_p.tbl_summary")
testthat::skip_on_cran()

test_that("add_p creates output without error/warning", {
expect_error(
Expand Down
48 changes: 24 additions & 24 deletions tests/testthat/test-as_gt.R
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
context("test-as_gt")
testthat::skip_on_cran()

if (requireNamespace("gt", quietly = TRUE)) {
test_that("tbl_summary", {
expect_error(tbl_summary(trial) %>% as_gt(), NA)
expect_warning(tbl_summary(trial) %>% as_gt(), NA)
})
test_that("tbl_summary", {
expect_error(tbl_summary(trial) %>% as_gt(), NA)
expect_warning(tbl_summary(trial) %>% as_gt(), NA)
})

test_that("tbl_summary", {
expect_error(tbl_summary(trial) %>% as_gt(return_calls = TRUE), NA)
expect_warning(tbl_summary(trial) %>% as_gt(return_calls = TRUE), NA)
})
test_that("tbl_summary", {
expect_error(tbl_summary(trial) %>% as_gt(return_calls = TRUE), NA)
expect_warning(tbl_summary(trial) %>% as_gt(return_calls = TRUE), NA)
})

test_that("tbl_regression", {
expect_error(lm(marker ~ age, trial) %>% tbl_regression() %>% as_gt(), NA)
expect_warning(lm(marker ~ age, trial) %>% tbl_regression() %>% as_gt(), NA)
})
test_that("tbl_regression", {
expect_error(lm(marker ~ age, trial) %>% tbl_regression() %>% as_gt(), NA)
expect_warning(lm(marker ~ age, trial) %>% tbl_regression() %>% as_gt(), NA)
})

test_that("tbl_uvregression", {
expect_error(trial %>% tbl_uvregression(method = lm, y = age) %>% as_gt(), NA)
expect_warning(trial %>% tbl_uvregression(method = lm, y = age) %>% as_gt(), NA)
})
test_that("tbl_uvregression", {
expect_error(trial %>% tbl_uvregression(method = lm, y = age) %>% as_gt(), NA)
expect_warning(trial %>% tbl_uvregression(method = lm, y = age) %>% as_gt(), NA)
})

test_that("tbl_survfit", {
library(survival)
fit1 <- survfit(Surv(ttdeath, death) ~ trt, trial)
test_that("tbl_survfit", {
library(survival)
fit1 <- survfit(Surv(ttdeath, death) ~ trt, trial)

expect_error(tbl_survfit(fit1, times = c(12, 24), label = "{time} Months") %>% as_gt(), NA)
expect_warning(tbl_survfit(fit1, times = c(12, 24), label = "{time} Months") %>% as_gt(), NA)
})

expect_error(tbl_survfit(fit1, times = c(12, 24), label = "{time} Months") %>% as_gt(), NA)
expect_warning(tbl_survfit(fit1, times = c(12, 24), label = "{time} Months") %>% as_gt(), NA)
})
}
2 changes: 2 additions & 0 deletions tests/testthat/test-combine_terms.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
context("test-combine_terms")
testthat::skip_on_cran()

library(Hmisc)
mod1 <- lm(age ~ marker + I(marker^2) + stage,
trial[c("age", "marker", "stage")] %>% na.omit())
Expand Down
14 changes: 9 additions & 5 deletions tests/testthat/test-inline_text.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("test-inline_text")
testthat::skip_on_cran()


# inline_text.tbl_summary tests --------------
Expand Down Expand Up @@ -82,11 +83,14 @@ test_that("inline_text.tbl_summary: with by - expect errors", {
})

test_that("inline_text.tbl_summary: no errors with empty string selection", {
trial %>%
select(grade) %>%
mutate(grade = ifelse(grade == "I", "", as.character(grade))) %>%
tbl_summary() %>%
inline_text(variable = grade, level = "III")
expect_error(
trial %>%
select(grade) %>%
mutate(grade = ifelse(grade == "I", "", as.character(grade))) %>%
tbl_summary() %>%
inline_text(variable = grade, level = "III"),
NA
)
})


Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-tbl_cross.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("test-tbl_cross")
testthat::skip_on_cran()

test_that("tbl_cross- throws error if both `col` and `row`` are not specified", {
expect_error(
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-tbl_merge.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("test-tbl_merge")
testthat::skip_on_cran()

library(survival)
library(purrr)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-tbl_regression.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("test-tbl_regression")
testthat::skip_on_cran()
library(survival)
library(lme4)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-tbl_stack.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("test-tbl_stack")
testthat::skip_on_cran()
library(survival)
t1 <-
glm(response ~ trt, trial, family = binomial) %>%
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-tbl_summary.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("test-tbl_summary")
testthat::skip_on_cran()

test_that("tbl_summary creates output without error/warning (no by var)", {
expect_error(
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-tbl_survfit.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("test-tbl_survfit")
testthat::skip_on_cran()
library(survival)

test_that("no errors/warnings with stratified variable", {
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-tbl_survival.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("test-tbl_survival")
testthat::skip_on_cran()
library(survival)

test_that("no errors/warnings with stratified variable", {
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-tbl_uvregression.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("test-tbl_uvregression")
testthat::skip_on_cran()
library(survival)
library(lme4)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-vetted_models-clogit.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# - works with add_global_p(), add_nevent(), add_q()

context("test-vetted_models")
testthat::skip_on_cran()
library(dplyr)
library(survival)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-vetted_models-coxph.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# - works with add_global_p(), add_nevent(), add_q()

context("test-vetted_models-coxph")
testthat::skip_on_cran()
library(dplyr)
library(survival)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-vetted_models-geeglm.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# - works with add_global_p(), add_nevent(), add_q()

context("test-vetted_models")
testthat::skip_on_cran()
library(dplyr)

# geeglm() --------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-vetted_models-glm.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@


context("test-vetted_models-glm")
testthat::skip_on_cran()
library(dplyr)

# glm() ------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-vetted_models-glmer.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# - works with add_global_p(), add_nevent(), add_q()

context("test-vetted_models-glmer")
testthat::skip_on_cran()
library(dplyr)

# glmer() --------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-vetted_models-lm.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# - works with add_global_p(), add_nevent(), add_q()

context("test-vetted_models-lm")
testthat::skip_on_cran()
library(dplyr)

# lm() ------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-vetted_models-lmer.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# - works with add_global_p(), add_nevent(), add_q()

context("test-vetted_models-lmer")
testthat::skip_on_cran()
library(dplyr)

# lmer() -----------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-vetted_models-survreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
# survival::clogit() DONE

context("test-vetted_models-survreg")
testthat::skip_on_cran()
library(dplyr)
library(survival)

Expand Down
3 changes: 2 additions & 1 deletion vignettes/gallery.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ gt_eventn <-
statistic = all_categorical() ~ "{n}",
label = list(stage ~ "T Stage", grade ~ "Grade")
) %>%
modify_header(stat_0 ~ "**Event N**")
modify_header(stat_0 ~ "**Event N**") %>%
modify_footnote(everything() ~ NA_character_)
tbl_merge(list(gt_eventn, gt_model)) %>%
bold_labels() %>%
Expand Down
Loading

0 comments on commit e15ff6f

Please sign in to comment.