diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index eca2be361..ef4ac08f1 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ -Version: 0.18.2 -Date: 2022-08-10 06:14:58 UTC -SHA: a09371bf70ac7b416e6d718db7e5dcea9e3211f8 +Version: 0.18.3 +Date: 2022-09-18 18:53:53 UTC +SHA: f7d20be0cb4847676f9c82720449189852f9380b diff --git a/DESCRIPTION b/DESCRIPTION index f7ecb9e4d..742b88385 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: insight Title: Easy Access to Model Information for Various Model Objects -Version: 0.18.2.9 +Version: 0.18.3 Authors@R: c(person(given = "Daniel", family = "Lüdecke", @@ -158,7 +158,7 @@ VignetteBuilder: knitr Encoding: UTF-8 Language: en-US -RoxygenNote: 7.2.1.9000 +RoxygenNote: 7.2.1 Roxygen: list(markdown = TRUE) Config/testthat/edition: 3 Config/Needs/website: diff --git a/R/get_statistic.R b/R/get_statistic.R index d61f185dc..b0c7d17a8 100644 --- a/R/get_statistic.R +++ b/R/get_statistic.R @@ -565,7 +565,7 @@ get_statistic.coxph <- function(x, ...) { # avoid calling default method which would be computationally wasteful, since # we need summary() here. cs <- suppressWarnings(stats::coef(summary(x))) - column_index <- grep("^z$|^t$", colnames(cs)) + column_index <- grep("^z$|^t$|Chisq", colnames(cs)) out <- data.frame( Parameter = row.names(cs), Statistic = cs[, column_index, drop = TRUE], diff --git a/cran-comments.md b/cran-comments.md index 845b15328..e69de29bb 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1 +0,0 @@ -This release fixes CRAN check errors. Please cancel the submussion of insight 0.18.1, as this submission fixes issues with packages that have non-standard licenses. \ No newline at end of file diff --git a/tests/testthat/test-coxph.R b/tests/testthat/test-coxph.R index e46701ac0..fd366fda2 100644 --- a/tests/testthat/test-coxph.R +++ b/tests/testthat/test-coxph.R @@ -148,4 +148,13 @@ test_that("get_statistic", { z1 <- get_statistic(mod)$Statistic z2 <- coef(summary(mod))[, "z"] expect_equal(z1, z2, ignore_attr = TRUE) + + lung <- survival::lung + mod <- survival::coxph( + formula = Surv(time, status) ~ age + sex + frailty(inst), + data = lung + ) + z1 <- get_statistic(mod)$Statistic + z2 <- coef(summary(mod))[, "Chisq"] + expect_equal(z1, z2, ignore_attr = TRUE) })