-
Notifications
You must be signed in to change notification settings - Fork 12
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
PD > IPD and display site activation / participant enrollment in study info. #1945
Conversation
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.
A few minor things
R/util-CalculatePercentage.R
Outdated
@@ -15,15 +15,22 @@ | |||
#' @return A data frame containing two additional columns for the precentage value and associated string | |||
#' @export | |||
CalculatePercentage <- function(data, strCurrentCol, strTargetCol, strPercVal, strPercStrVal) { | |||
if (!(strCurrentCol %in% names(data) & strTargetCol %in% names(data))) { | |||
if (!(strCurrentCol %in% names(data))) { | |||
cli::cli_abort("Check that both {strCurrentCol} and {strTargetCol} are in 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.
cli::cli_abort("Check that both {strCurrentCol} and {strTargetCol} are in data") | |
cli::cli_abort("Check that {strCurrentCol} is in {data}") |
} else { | ||
data <- data %>% | ||
dplyr::mutate( | ||
{{ strPercStrVal }} := .data[[strCurrentCol]] |
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.
The argument name strPercStrVal feels a little deceiving here perhaps we should consider a renaming of the argument (?), and I could see why target/denominator numbers wouldn't be available soemtimes. If I'm interpreting correctly, if the denominator column isn't available you still want to be able to run this and return a new column which is just the numerator renamed?
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.
Yep, that would be my preference - if the target column is missing set site activation and participant enrollment to the numerator.
Overview
Minor tweaks to:
1_mappings/STUDY.yaml
: RemoveLabel
suffix2_metrics/cou0004.yaml
:PD
>IPD
2_metrics/kri0004.yaml
:PD
>IPD
R/Report_StudyInfo.R
:SiteCount
>SiteActivation
andParticipantCount
>ParticipantEnrollment
R/util-CountPercentage.R
: works without target columnTest Notes/Sample Code
Connected Issues
SiteActivation
andParticipantEnrollment
fields in study info. #1944