Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rifttable
Type: Package
Title: Results Tables to Bridge the Rift Between Epidemiologists and Their Data
Version: 0.7.1
Version: 0.7.2
Authors@R:
person(given = "Konrad H.",
family = "Stopsack",
Expand All @@ -19,7 +19,7 @@ License: GPL (>= 3)
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
Depends:
R (>= 4.1.0)
Imports:
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# rifttable 0.7.2

* Bug fixes:
+ `survdiff_ci()` now uses the `conf.level` argument correctly in confidence
interval estimation using the MOVER approach (#8).
* Internal:
+ Anticipate changes in {dplyr} 1.2.0 in label handling in unit tests (thanks
to @DavisVaughan, #10).


# rifttable 0.7.1

* Housekeeping for CRAN release
Expand Down
3 changes: 2 additions & 1 deletion R/survdiff_ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ survdiff_ci <- function(
formula = formula,
data = data,
id = .id,
weights = .weights
weights = .weights,
conf.int = conf.level
),
time = time,
extend = TRUE
Expand Down
14 changes: 12 additions & 2 deletions tests/testthat/test-missing_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@ data("breastcancer", package = "risks")
df <- breastcancer |>
dplyr::mutate(
continuous = 1:dplyr::n(),
receptor = dplyr::if_else(dplyr::row_number() %in% 9:11, NA, receptor),
receptor = {
label <- attr(receptor, "label")
receptor <- dplyr::if_else(dplyr::row_number() %in% 9:11, NA, receptor)
attr(receptor, "label") <- label
receptor
},
stage = dplyr::if_else(dplyr::row_number() %in% 29:31, NA, stage),
death = dplyr::if_else(dplyr::row_number() %in% 99:101, NA, death),
death = {
label <- attr(death, "label")
death <- dplyr::if_else(dplyr::row_number() %in% 99:101, NA, death)
attr(death, "label") <- label
death
},
allempty = NA_real_,
allempty_lgl = allempty == 1
)
Expand Down
14 changes: 12 additions & 2 deletions tests/testthat/test-table1_design.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@ data("breastcancer", package = "risks")
df <- breastcancer |>
dplyr::mutate(
continuous = 1:dplyr::n(),
receptor = dplyr::if_else(dplyr::row_number() %in% 9:11, NA, receptor),
death = dplyr::if_else(dplyr::row_number() %in% 99:101, NA, death),
receptor = {
label <- attr(receptor, "label")
receptor <- dplyr::if_else(dplyr::row_number() %in% 9:11, NA, receptor)
attr(receptor, "label") <- label
receptor
},
death = {
label <- attr(death, "label")
death <- dplyr::if_else(dplyr::row_number() %in% 99:101, NA, death)
attr(death, "label") <- label
death
},
allempty = NA_integer_,
allempty_lgl = allempty == 1
)
Expand Down
44 changes: 44 additions & 0 deletions tests/testthat/test-time2.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,50 @@ testthat::test_that(
)


testthat::test_that(
desc = "cum inc difference does not ignore confidence level",
code = {
result <- survdiff_ci(
formula = survival::Surv(
time = time,
event = status
) ~
sex,
data = cancer,
time = 365.25
)

result09 <- survdiff_ci(
formula = survival::Surv(
time = time,
event = status
) ~
sex,
data = cancer,
time = 365.25,
conf.level = 0.9
)

expect_gt(
object = result09$conf.low,
expected = result$conf.low
)
expect_lt(
object = result09$conf.high,
expected = result$conf.high
)
expect_equal(
object = result09$estimate,
expected = result$estimate
)
expect_equal(
object = result09$std.error,
expected = result$std.error,
tolerance = 0.01
)
}
)

testthat::test_that(
desc = "Invalid ID variable is found",
code = {
Expand Down