-
Notifications
You must be signed in to change notification settings - Fork 1
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
Revise RMD calculations #47
Conversation
@@ -44,6 +44,7 @@ | |||
#' - pf: RMD in PF state | |||
#' - pd: RMD in PD state | |||
#' - os: RMD in either alive state | |||
#' @importFrom rlang .data |
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.
Note to self: this is already in NAMESPACE
, so the documentation doesn't need to be regenerated
Line 30 in 2f84e17
importFrom(rlang,.data) |
@@ -87,22 +88,22 @@ drmd_psm <- function(ptdata, dpam, psmtype="simple", Ty=10, discrate=0, lifetabl | |||
ds <- ds |> | |||
dplyr::mutate( | |||
# Derive the background mortality for this timepoint | |||
cqx = 1 - dplyr::lead(clx)/clx, | |||
cqx = 1 - dplyr::lead(.data$clx)/.data$clx, |
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.
What is your motivation for prefixing all the variables with .data$
? Are you trying to remove R CMD check
NOTEs about undefined global variables?
An alternative to prefixing with .data$
is to add the variables you use in tidyverse functions to utils::globalVariables()
(you'd also need to add utils
to Imports). You can see how we do this in {gsDesign2} and {simtrial}
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.
That's probably a better way! Yes it's to remove R CMD check notes. There are various other functions with the same issue/behavior, so I should go through them all - thanks for showing me the better practice in gsDesign2 and simtrial.
Use a consistent and simpler approach for discretized calculations that depends on calculation of PPD mortality by method