Skip to content

Conversation

@roninsightrx
Copy link
Collaborator

@roninsightrx roninsightrx commented Feb 11, 2026

Received a notification from CRAN that package is resulting in built errors, mostly caused by deprecations in the dependency library dplyr. Here is the error report: https://cran.r-project.org/web/checks/check_results_vpc.html.
Also reported earlier in this PR.

ronkeizer and others added 4 commits June 13, 2024 20:57
Replace defunct dplyr functions (group_by_(), arrange_(), do()) with
modern equivalents using .data pronoun. Fix \itemize Rd markup to use
\describe with proper \item{name}{description} syntax. Remove broken
\link{sim_data} cross-references. Bump version to 1.2.4.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates vpc to address CRAN check failures caused by defunct dplyr underscored verbs by switching to modern dplyr equivalents and cleaning up related documentation issues.

Changes:

  • Replaced defunct dplyr verbs (group_by_(), arrange_(), do()) with modern equivalents using tidy-eval (.data) and slice().
  • Fixed Rd formatting for new_vpc_theme() details by switching to \describe{} syntax.
  • Removed broken \link{sim_data} references and updated release metadata (DESCRIPTION/NEWS) plus added cran-comments.md.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
man/vpc-package.Rd Adds an alias entry for the package help topic.
man/new_vpc_theme.Rd Updates Rd list formatting to avoid “Lost braces”/format warnings.
cran-comments.md Adds CRAN submission notes and test environment info.
R/vpc_tte.R Removes broken sim_data cross-reference in @seealso.
R/vpc_cens.R Removes broken sim_data cross-reference in @seealso.
R/vpc_cat.R Removes broken sim_data cross-reference in @seealso.
R/vpc.R Removes broken sim_data cross-reference in @seealso.
R/plot_vpc.R Removes broken sim_data cross-reference in @seealso.
R/new_vpc_theme.R Updates roxygen details block to proper \describe{} format.
R/functions.R Replaces defunct dplyr verbs in internal helpers with modern dplyr + .data.
R/compute_kmmc.R Replaces defunct group_by_() usage with .data-based group_by().
NEWS.md Bumps version and documents the dplyr/doc fixes.
DESCRIPTION Bumps version/date and updates RoxygenNote.
Comments suppressed due to low confidence (1)

R/compute_kmmc.R:20

  • compute_kmmc() iterates over strats but never subsets dat to the current stratum, so each loop computes the same curve and only changes the strat label. Filter dat (or the computed summid) to dat[[strat]] == strats[i] inside the loop (similar to compute_kaplan()) before calculating km_fit.
    strats <- unique(dat[[strat]])
    tmp <- c()
    for (i in seq(strats)) {
      summid <- dat %>% dplyr::group_by(.data$id) %>% dplyr::mutate(covt = mean(kmmc))
      t <- unique(summid$time)
      km_fit <- data.frame(time = t[order(t)], surv=1)
      for (j in seq(km_fit$time)) {
        km_fit$surv[j] <- mean(summid[summid$time >= km_fit$time[j],]$covt)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 15 to +16
for (i in seq(strats)) {
summid <- dat %>% dplyr::group_by_("id") %>% dplyr::mutate(covt = mean(kmmc))
summid <- dat %>% dplyr::group_by(.data$id) %>% dplyr::mutate(covt = mean(kmmc))
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no test coverage for the kmmc path in vpc_tte()/compute_kmmc() (e.g., stratified KMMC curves). Adding a focused test that exercises vpc_tte(..., kmmc=...) would help catch regressions from dplyr/tidy-eval changes.

Copilot uses AI. Check for mistakes.
Comment on lines 51 to 52
}
return(tmp2)
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert_to_dense_grid() returns tmp2 even when add is NULL, but tmp2 is only assigned inside the if (!is.null(add)) block. This will error for the default add = NULL; initialize tmp2 <- tmp (or return tmp directly) when no additional columns are requested.

Suggested change
}
return(tmp2)
return(tmp2)
} else {
return(tmp)
}

Copilot uses AI. Check for mistakes.
@roninsightrx roninsightrx merged commit 1828aaa into master Feb 11, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants