Skip to content

Commit

Permalink
Fix tests - deprecate pairwise and add another test for `format_cou…
Browse files Browse the repository at this point in the history
…nt_fraction` (#987)

Closes #984
  • Loading branch information
edelarua authored Jun 26, 2023
1 parent 800fc42 commit 7071f31
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 56 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ export(logistic_summary_by_flag)
export(month2day)
export(or_clogit)
export(or_glm)
export(pairwise)
export(prop_agresti_coull)
export(prop_clopper_pearson)
export(prop_diff_cmh)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

### Miscellaneous
* Began deprecation of `time_unit_input` and `time_unit_output` arguments and replaced them with the `input_time_unit` and `num_pt_year`, respectively, in `control_incidence_rate`.
* Removed deprecated `pairwise` function.

# tern 0.8.3

Expand Down
22 changes: 0 additions & 22 deletions R/coxph.R
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
#' Pairwise Formula Special Term
#'
#' @description `r lifecycle::badge("deprecated")`
#'
#' The special term `pairwise` indicate that the model should be fitted individually for
#' every tested level in comparison to the reference level.
#'
#' @param x the variable for which pairwise result is expected.
#'
#' @return Variable "paired".
#'
#' @details Let's `ARM` being a factor with level A, B, C; let's be B the reference level,
#' a model calling the formula including `pairwise(ARM)` will result in two models:
#' * A model including only levels A and B, and effect of A estimated in reference to B.
#' * A model including only levels C and B, the effect of C estimated in reference to B.
#'
#' @export
pairwise <- function(x) {
lifecycle::deprecate_warn("0.8.1.9013", "pairwise()", "univariate()")
structure(x, varname = deparse(substitute(x)))
}

#' Univariate Formula Special Term
#'
#' @description `r lifecycle::badge("stable")`
Expand Down
5 changes: 0 additions & 5 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,3 @@ reference:
desc: Data included in the package.
contents:
- starts_with("ex_")

- title: Deprecated Functions
desc: Functions that are currently deprecated within `tern`.
contents:
- pairwise
28 changes: 0 additions & 28 deletions man/pairwise.Rd

This file was deleted.

5 changes: 5 additions & 0 deletions tests/testthat/test-formats.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ testthat::test_that("format_count_fraction works with count of 0", {
testthat::expect_snapshot(res)
})

testthat::test_that("format_count_fraction works with NA input", {
result <- format_count_fraction(NA)
testthat::expect_identical(result, "NA")
})

testthat::test_that("format_count_fraction_fixed_dp works with healthy inputs", {
result <- format_count_fraction_fixed_dp(c(2, 0.5))

Expand Down

0 comments on commit 7071f31

Please sign in to comment.