Skip to content
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

addresses #578 - use dplyr::select insstead of select_ #579

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

tbaer-c7ks7s
Copy link

@tbaer-c7ks7s tbaer-c7ks7s commented Apr 1, 2022

also related to #460 , #577, #509, and #546

there are two ways to fix this select warning

  1. remove the quotes from the vector elements and remove the vector
  2. use !!!syms in front of the vector like Fix for dplyr 1.0.0 #460

I chose 1 because I think it's simpler

I also added a test

@tbaer-c7ks7s
Copy link
Author

sorry, this is the same person that opened the issue here, just on a different account. I don't mean to confuse. I was having trouble with that account

Copy link
Owner

@kassambara kassambara left a comment

Choose a reason for hiding this comment

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

Thank you so much for this merge request and the added unit tests, highly appreciated. Just 2 minor comments. Would you have time to adress them, so that we can merge?

Comment on lines 164 to 165
dplyr::select(strata, time, n.risk, pct.risk, n.event, cum.n.event,
n.censor, cum.n.censor, strata_size)
Copy link
Owner

Choose a reason for hiding this comment

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

To avoid R cmd check warning, quotes are needed around variables. The code should look like this:

dplyr::select( dplyr::all_of(c("strata", "time", "n.risk", "pct.risk",
                          "n.event", "cum.n.event", "n.censor",
                          "cum.n.censor", "strata_size")))

R/surv_median.R Outdated
@@ -59,7 +59,7 @@ surv_median <- function(fit, combine = FALSE){
.table$strata <- rownames(.table)

.table <- .table %>%
dplyr::select_(.dots = c("strata", "median", "`0.95LCL`", "`0.95UCL`"))
dplyr::select(strata, median, `0.95LCL`, `0.95UCL`)
Copy link
Owner

Choose a reason for hiding this comment

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

As above (to avoid R check warnings), the code should be:

dplyr::select(dplyr::all_of(c("strata",  "median", "0.95LCL", "0.95UCL")))

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.

None yet

2 participants