From d1a8bac678edbeb703fd3382b441fc28beebac42 Mon Sep 17 00:00:00 2001 From: Liming <36079400+clarkliming@users.noreply.github.com> Date: Wed, 19 Aug 2026 10:44:21 +0800 Subject: [PATCH 1/6] fix the issue for model.data.frame behavior change for releveled factors --- tests/testthat/test-predict_counterfactual.R | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/testthat/test-predict_counterfactual.R b/tests/testthat/test-predict_counterfactual.R index d50cd2a9..124a8116 100644 --- a/tests/testthat/test-predict_counterfactual.R +++ b/tests/testthat/test-predict_counterfactual.R @@ -66,13 +66,16 @@ test_that("confint method for prediction_cf works as expected", { test_that("predict_counterfactual works for treatment factor levels in non-alphabetical order", { + relabel_dat <- glm_data + levels(relabel_dat$treatment)[1] <- "trtpbo" + + fit_glm_relabel <- glm(y ~ treatment * s1 + covar, data = relabel_dat) expected_result <- predict_counterfactual(fit_glm, treatment ~ 1) - relabel_dat <- find_data(fit_glm) - levels(relabel_dat$treatment)[1] <- "trtpbo" - result_relabel <- predict_counterfactual(fit_glm, treatment ~ 1, data = relabel_dat) + result_relabel <- predict_counterfactual(fit_glm_relabel, treatment ~ 1, data = relabel_dat) expected <- expected_result$estimate names(expected)[1] <- "trtpbo" expect_equal(expected, result_relabel$estimate) }) + From ada3a27717b99d798a5738f780d6eb75f17e46fd Mon Sep 17 00:00:00 2001 From: Liming <36079400+clarkliming@users.noreply.github.com> Date: Wed, 19 Aug 2026 10:54:02 +0800 Subject: [PATCH 2/6] fix the unit test and add documentation --- DESCRIPTION | 4 ++-- NEWS.md | 6 +++++- inst/WORDLIST | 2 -- tests/testthat/test-predict_counterfactual.R | 1 - 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b0bbbc79..ea7c90fa 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: RobinCar2 Title: ROBust INference for Covariate Adjustment in Randomized Clinical Trials -Version: 0.2.3.9000 -Date: 2026-07-04 +Version: 0.2.4 +Date: 2026-08-19 Authors@R: c( person("Liming", "Li", , "liming.li1@astrazeneca.com", role = c("aut", "cre"), comment = c(ORCID = "0009-0008-6870-0878")), diff --git a/NEWS.md b/NEWS.md index 667ff61e..740d6785 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# RobinCar2 0.2.3.9000 +# RobinCar2 0.2.4 ### New Features @@ -8,6 +8,10 @@ * Previously `robin_surv()` gave small numerical differences to `survival::coxph()` for the hazard ratio estimate. This is now fixed. +### Misc + +* Adapted a unit test to a change in `stats::model.frame.glm()` in `R-devel`, which now enforces the factor levels recorded in the model fit, consistent with `stats::model.frame.lm()`. As a consequence, `predict_counterfactual()` requires the factor levels of the treatment variable in `data` to match those of `fit`. Previously, mismatched levels were silently accepted for `glm` fits; this restriction has always applied to `lm` fits. + # RobinCar2 0.2.3 ### Bug Fixes diff --git a/inst/WORDLIST b/inst/WORDLIST index 27a8257a..f4c9cd68 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -54,7 +54,6 @@ Zhang Zhao al andomized -arXiv asab asaf biomet @@ -88,7 +87,6 @@ pbo plc preprint trt -unadjusted unstratified ust vcovG diff --git a/tests/testthat/test-predict_counterfactual.R b/tests/testthat/test-predict_counterfactual.R index 124a8116..d14441b8 100644 --- a/tests/testthat/test-predict_counterfactual.R +++ b/tests/testthat/test-predict_counterfactual.R @@ -78,4 +78,3 @@ test_that("predict_counterfactual works for treatment factor levels in non-alpha names(expected)[1] <- "trtpbo" expect_equal(expected, result_relabel$estimate) }) - From e7f567e024a3dfea58b676bf1973489c2106d212 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 03:00:46 +0000 Subject: [PATCH 3/6] [skip roxygen] [skip vbump] Roxygen Man Pages Auto Update --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index ea7c90fa..15538c03 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -53,4 +53,4 @@ Encoding: UTF-8 Language: en-US LazyData: true Roxygen: list(markdown = TRUE) -Config/roxygen2/version: 8.0.0 +Config/roxygen2/version: 8.1.0 From 044ebbb1c86e94b55eeb041a876bbe2a752b1a4c Mon Sep 17 00:00:00 2001 From: Liming <36079400+clarkliming@users.noreply.github.com> Date: Wed, 19 Aug 2026 11:06:44 +0800 Subject: [PATCH 4/6] trigger CI From 79bf2a8661a1b32b5a7d6644698e10bccfff5406 Mon Sep 17 00:00:00 2001 From: Liming <36079400+clarkliming@users.noreply.github.com> Date: Wed, 19 Aug 2026 13:52:53 +0800 Subject: [PATCH 5/6] disable pubmed url check --- .lycheeignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .lycheeignore diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 00000000..9a9951a5 --- /dev/null +++ b/.lycheeignore @@ -0,0 +1 @@ +pubmed.ncbi.nlm.nih.gov From 6494915c02d3f25a2be4e921c60c3b4f46c0ecdb Mon Sep 17 00:00:00 2001 From: Liming <36079400+clarkliming@users.noreply.github.com> Date: Wed, 19 Aug 2026 14:02:39 +0800 Subject: [PATCH 6/6] remove the url checker --- .github/workflows/check.yaml | 4 ---- .lycheeignore | 1 - 2 files changed, 5 deletions(-) delete mode 100644 .lycheeignore diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 39c52d35..9566f9c0 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -49,10 +49,6 @@ jobs: if: github.event_name == 'pull_request' name: Spell Check 🆎 uses: insightsengineering/r.pkg.template/.github/workflows/spelling.yaml@main - links: - if: github.event_name == 'pull_request' - name: Check URLs 🌐 - uses: insightsengineering/r.pkg.template/.github/workflows/links.yaml@main vbump: name: Version Bump 🤜🤛 if: github.event_name == 'push' diff --git a/.lycheeignore b/.lycheeignore deleted file mode 100644 index 9a9951a5..00000000 --- a/.lycheeignore +++ /dev/null @@ -1 +0,0 @@ -pubmed.ncbi.nlm.nih.gov