-
Notifications
You must be signed in to change notification settings - Fork 20
Fix dplyr deprecation issue #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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>
There was a problem hiding this 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) andslice(). - 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 addedcran-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 overstratsbut never subsetsdatto the current stratum, so each loop computes the same curve and only changes thestratlabel. Filterdat(or the computedsummid) todat[[strat]] == strats[i]inside the loop (similar tocompute_kaplan()) before calculatingkm_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.
| 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)) |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
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.
| } | ||
| return(tmp2) |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
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.
| } | |
| return(tmp2) | |
| return(tmp2) | |
| } else { | |
| return(tmp) | |
| } |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.