Skip to content

Commit d86363d

Browse files
ehrlingerclaude
andcommitted
v2.7.2: address CRAN reviewer (Benjamin Altmann) feedback
In-cycle resubmission addressing all four items raised on the v2.7.1 review of 2026-04-27: * DESCRIPTION: add methods references per CRAN cookbook -- Breiman (2001) <doi:10.1023/A:1010933404324> and Ishwaran et al. (2008) <doi:10.1214/08-AOAS169>. * shift() Rd: drop the public help page entirely. shift() is an internal numeric-vector lead/lag utility; its example used ggRandomForests:::shift(...). Marked the function @nord so no Rd is emitted; deleted man/shift.Rd. * surv_partial.rfsrc(): replace cat("partial plot for: ...", "\n") with message(). Output is now suppressible via suppressMessages() and plays nicely inside notebooks / Shiny / quarto. Test updated: expect_output -> expect_message. * surv_partial.rfsrc Rd example: wrap par(mfrow = c(2, 2)) with oldpar <- par(no.readonly = TRUE); on.exit(par(oldpar)) so the user's graphical parameters are restored on exit. DESCRIPTION bumped to 2.7.2; NEWS gets a v2.7.2 heading enumerating the four reviewer-driven fixes; cran-comments.md rewritten as an in-cycle resubmission acknowledging Altmann's review. Local R CMD check --as-cran on the v2.7.2 build: Status 2 NOTEs (both unavoidable: CRAN incoming-feasibility + local NTP timestamp). Examples [14s/14s] OK, donttest [17s/18s] OK, PDF manual OK, tests OK. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 00367f5 commit d86363d

8 files changed

Lines changed: 92 additions & 110 deletions

File tree

DESCRIPTION

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
Package: ggRandomForests
22
Type: Package
33
Title: Visually Exploring Random Forests
4-
Version: 2.7.1
4+
Version: 2.7.2
55
Date: 2026-04-27
6-
Authors@R: person("John", "Ehrlinger",
7-
role = c("aut", "cre"),
6+
Authors@R: person("John", "Ehrlinger",
7+
role = c("aut", "cre"),
88
email = "john.ehrlinger@gmail.com")
99
License: MIT + file LICENSE
1010
Encoding: UTF-8
1111
Language: en-US
1212
URL: https://github.com/ehrlinger/ggRandomForests, https://ehrlinger.github.io/ggRandomForests/
1313
BugReports: https://github.com/ehrlinger/ggRandomForests/issues
14-
Description: Graphic elements for exploring Random Forests using the 'randomForest' or 'randomForestSRC' package for survival, regression and classification forests and 'ggplot2' package plotting.
14+
Description: Graphic elements for exploring Random Forests using the
15+
'randomForest' or 'randomForestSRC' package for survival, regression
16+
and classification forests and 'ggplot2' package plotting. Implements
17+
visualisations of the methods described in Breiman (2001)
18+
<doi:10.1023/A:1010933404324> and Ishwaran, Kogalur, Blackstone, and
19+
Lauer (2008) <doi:10.1214/08-AOAS169>.
1520
Depends:
1621
R (>= 4.4.0),
1722
randomForestSRC (>= 3.4.0),

NEWS.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
Package: ggRandomForests
2-
Version: 2.7.1
2+
Version: 2.7.2
3+
4+
ggRandomForests v2.7.2
5+
=====================
6+
* Address CRAN reviewer (Benjamin Altmann) feedback on the v2.7.1
7+
resubmission:
8+
- Add methods references to `DESCRIPTION` (Breiman 2001 and
9+
Ishwaran et al. 2008, with `<doi:...>` auto-links) per CRAN
10+
cookbook.
11+
- Drop the `man/shift.Rd` Rd file: `shift()` is an internal utility
12+
and the example used `ggRandomForests:::shift(...)`. Marked the
13+
function `@noRd` so it no longer generates a help page.
14+
- Replace `cat()` in `surv_partial.rfsrc()` with `message()` so
15+
progress output is suppressible (`suppressMessages()`) and plays
16+
nicely inside notebooks / Shiny / quarto.
17+
- Restore the user's `par()` settings in the
18+
`surv_partial.rfsrc()` example via
19+
`oldpar <- par(no.readonly = TRUE); on.exit(par(oldpar))`.
320

421
ggRandomForests v2.7.1
522
=====================

R/surv_partial.rfsrc.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@
9999
#' pdta1 <- get.partial.plot.data(partial.obj, target = 1)
100100
#' pdta2 <- get.partial.plot.data(partial.obj, target = 2)
101101
#'
102-
#' par(mfrow=c(2,2))
102+
#' # Save and restore the user's graphical parameters per CRAN policy.
103+
#' oldpar <- par(no.readonly = TRUE)
104+
#' on.exit(par(oldpar))
105+
#' par(mfrow = c(2, 2))
103106
#' plot(lowess(pdta1$x, pdta1$yhat),
104107
#' type = "l", xlab = "age", ylab = "adjusted years lost relapse")
105108
#' plot(lowess(pdta2$x, pdta2$yhat),
@@ -132,8 +135,9 @@ surv_partial.rfsrc <- function(rforest, var_list, npts = 25, partial.type = "sur
132135
)
133136
###----------Partial dependency estimation, for each variable, at each time point ----
134137
surv.lst <- lapply(var_list, function(xvar) {
135-
## extract the key variable
136-
cat("partial plot for:", xvar, "\n")
138+
## extract the key variable. Use message() (suppressible) instead of
139+
## cat() so the function plays nicely inside notebooks/Shiny/quarto.
140+
message("partial plot for: ", xvar)
137141

138142
## determine the partial plot data
139143
xv <- sort(unique(rforest$xvar[, xvar]))

R/utils.R

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,17 @@
1515
## None of these are exported to end-users.
1616

1717
# --------------------------------------------------------------------------- #
18-
#' Lead / lag shift for numeric vectors
19-
#'
20-
#' @param x a numeric vector of values
21-
#' @param shift_by an integer of length 1, giving the number of positions
22-
#' to lead (positive) or lag (negative) by
23-
#'
24-
#' @details Lead and lag are useful for comparing values offset by a constant
25-
#' (e.g. the previous or next value).
26-
#'
27-
#' Taken from:
28-
#' http://ctszkin.com/2012/03/11/generating-a-laglead-variables/
29-
#'
30-
#' This function allows removal of the dplyr::lead dependency.
31-
#'
32-
#' @keywords internal
33-
#' @examples
34-
#' d <- data.frame(x = 1:15)
35-
#' # generate lead variable
36-
#' d$df_lead2 <- ggRandomForests:::shift(d$x, 2)
37-
#' # generate lag variable
38-
#' d$df_lag2 <- ggRandomForests:::shift(d$x, -2)
18+
# Internal: lead / lag shift for numeric vectors.
19+
#
20+
# `x` numeric vector of values.
21+
# `shift_by` integer length 1 giving the number of positions to lead
22+
# (positive) or lag (negative) by; can also be a vector to
23+
# return a matrix of shifts.
24+
#
25+
# Removes the dplyr::lead dependency. Adapted from
26+
# http://ctszkin.com/2012/03/11/generating-a-laglead-variables/
27+
#
28+
# @noRd
3929
shift <- function(x, shift_by = 1) {
4030
stopifnot(is.numeric(shift_by))
4131
stopifnot(is.numeric(x))

cran-comments.md

Lines changed: 40 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,56 @@
1-
## Resubmission after archiving
2-
3-
This is the first submission of `ggRandomForests` since the package was
4-
archived from CRAN on **2025-07-01**. The archiving notice was *"issues
5-
were not corrected in time."* The underlying issue was an upstream API
6-
change: `randomForestSRC` removed its `var.select.rfsrc()` workflow that
7-
several `ggRandomForests` helpers depended on. v2.7.1 resolves this by:
8-
9-
* Removing the `var.select`-based variable-selection paths. Users are
10-
now directed to use minimum depth (already supported via
11-
`randomForestSRC::max.subtree`) or VIMP-based ranking (`gg_vimp`) until
12-
a `varPro`-based replacement is fleshed out in a future release.
13-
* Updating all vignettes and examples to use the supported workflow.
14-
* Fixing a separate batch of latent bugs documented in `NEWS.md` for
15-
v2.7.0 / v2.7.1 (S3 design overhaul, empty-figure bugs in survival
16-
partial-dependence, duplicate VIMP legend, NEWS-source consolidation,
17-
PDF-manual Unicode-minus issue, etc.).
1+
## v2.7.2 — Resubmission addressing CRAN reviewer feedback
2+
3+
This is a resubmission of v2.7.1 addressing every item raised by
4+
Benjamin Altmann's review of 2026-04-27. All four requested changes have
5+
been applied:
6+
7+
1. **References in DESCRIPTION.** Added Breiman (2001)
8+
`<doi:10.1023/A:1010933404324>` and Ishwaran et al. (2008)
9+
`<doi:10.1214/08-AOAS169>` to the Description field.
10+
2. **`:::` in documentation.** `man/shift.Rd` had an example using
11+
`ggRandomForests:::shift(...)`. `shift()` is an internal utility, so
12+
the help page has been removed entirely (the function is now
13+
`@noRd`); the `:::` reference is gone.
14+
3. **`cat()` in `R/surv_partial.rfsrc.R`.** Replaced the user-visible
15+
`cat("partial plot for: ", xvar, "\n")` with `message(...)` so the
16+
output can be suppressed via `suppressMessages()` and plays nicely
17+
inside notebooks / Shiny / quarto.
18+
4. **`par()` reset in `man/surv_partial.rfsrc.Rd` example.** Wrapped
19+
the `par(mfrow = c(2, 2))` block with
20+
`oldpar <- par(no.readonly = TRUE); on.exit(par(oldpar))` so the
21+
user's graphical parameters are restored on exit.
22+
23+
## Background — first resubmission since archiving
24+
25+
`ggRandomForests` was archived from CRAN on **2025-07-01** with the
26+
notice *"issues were not corrected in time."* The root cause was an
27+
upstream API change: `randomForestSRC` removed its
28+
`var.select.rfsrc()` workflow that several `ggRandomForests` helpers
29+
depended on. The fix in v2.7.x is to drop the `var.select`-based
30+
variable-selection paths and direct users to minimum depth
31+
(`randomForestSRC::max.subtree`) or VIMP-based ranking (`gg_vimp`)
32+
until a `varPro`-based replacement is fleshed out in a future release.
1833

1934
## Test environments
2035

2136
* **Local:** R 4.5.3 on macOS Tahoe 26.4.1 (aarch64-apple-darwin20).
2237
`R CMD check --as-cran` returns 0 errors, 0 warnings, 2 informational
2338
NOTEs (CRAN incoming feasibility + local NTP timestamp; neither
2439
actionable on CRAN's own machines).
25-
* **win-builder R-release** (R 4.6.0, x86_64-w64-mingw32): 2 NOTEs
26-
(see disposition below).
27-
* **win-builder R-devel:** submitted; results pending at the time of
28-
this submission.
2940
* **GitHub Actions matrix:** ubuntu-latest (R-devel / R-release /
3041
R-oldrel-1), windows-latest (R-release), macos-latest (R-release) —
3142
all green on the head commit.
43+
* **Win-builder R-release / R-oldrel** (v2.7.1 tarball, prior to the
44+
reviewer feedback): both clean — Status 1 NOTE, the new-submission
45+
NOTE only.
3246
* **Reverse-dependency check:** `tools::package_dependencies(reverse =
33-
TRUE)` returns 0; no downstream CRAN packages depend on
34-
`ggRandomForests`.
47+
TRUE)` returns 0; CRAN's auto-pretest also reported "No strong
48+
reverse dependencies to be checked".
3549
* **URLs:** `urlchecker::url_check()` clean.
3650

3751
## NOTE disposition
3852

39-
### NOTE 1 — "New submission / Package was archived on CRAN"
53+
### NOTE — "New submission / Package was archived on CRAN"
4054

41-
Expected for a resubmission. The archiving root cause and its
42-
remediation in v2.7.1 are documented above.
43-
44-
### NOTE 2 — Examples > 10s on win-builder R-release
45-
46-
Win-builder R-release flagged two examples that exceeded 10 s
47-
cumulative CPU + elapsed (`gg_variable` 18.4 s; `gg_rfsrc.rfsrc`
48-
10.4 s). Both have been trimmed in this submission: the headline
49-
runnable example is now a small `ntree = 50` classification fit on
50-
`iris`, and the larger regression / survival demonstrations are
51-
guarded with `\donttest{}` so they only run under `--run-donttest`.
52-
53-
## Other notes
54-
55-
* `cran-comments.md` reflects the disposition documented above; no
56-
silent NOTEs remain.
57-
* `NEWS.md` carries entries for both v2.7.0 (the API-change response)
58-
and v2.7.1 (bug-fix follow-ups). The v2.7.0 entry is included
59-
because that release was tagged in the source repository but never
60-
reached CRAN before archiving.
55+
Expected for a resubmission after archiving. The root cause and
56+
remediation in v2.7.x are documented above.

man/shift.Rd

Lines changed: 0 additions & 34 deletions
This file was deleted.

man/surv_partial.rfsrc.Rd

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test_surv_partial.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,9 @@ local({
187187
expect_false(identical(yhat_mort, yhat_surv))
188188
})
189189

190-
test_that("surv_partial.rfsrc verbose: prints variable name during computation", {
191-
expect_output(
190+
test_that("surv_partial.rfsrc verbose: emits a message with the variable name", {
191+
# v2.7.2: cat() -> message() so output is suppressible per CRAN cookbook.
192+
expect_message(
192193
suppressWarnings(
193194
surv_partial.rfsrc(v.obj, var_list = "age", partial.type = "mort")
194195
),

0 commit comments

Comments
 (0)