-
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
Fix #566 - Faceted charts for stratified analysis #567
Conversation
@samussiah to add a stratified PD Chart. |
I'm leaning toward adding a |
@samussiah - Is this ready for review? Happy to start one but just wanted to check since some of the CI is currently failing. |
Yeah, ready for review @mattroumaya. |
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.
Awesome work here @samussiah! I learned some new things from this review and think it looks great. Just added some minor comments but this looks good to merge after you review the suggested changes.
) | ||
lAssessments <- lAssessments %>% | ||
map(function(lAssessment) { | ||
Runction <- ifelse( |
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.
😄 💯
@@ -21,7 +22,7 @@ | |||
#' | |||
#' @export | |||
|
|||
Visualize_Count <- function(dfAnalyzed, strTotalCol = "N", strCountCol = "TotalCount", strTitle = "") { | |||
Visualize_Count <- function(dfAnalyzed, strGroupCol=NULL, strTotalCol = "N", strCountCol = "TotalCount", strTitle = "") { |
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.
Add to stopifnot()
below:
"strGroupCol must be character" = is.character(strGroupCol),
"strGroupCol not found in dfAnalyzed" = strGroupCol %in% names(dfAnalyzed)
#' @import ggplot2 | ||
#' | ||
#' @export | ||
|
||
Visualize_Scatter <- function(dfFlagged, dfBounds = NULL, strUnit = "days") { | ||
Visualize_Scatter <- function(dfFlagged, dfBounds = NULL, strGroupCol = NULL, strUnit = "days") { |
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.
Add to stopifnot()
below:
"strGroupCol must be character" = is.character(strGroupCol),
"strGroupCol not found in dfAnalyzed" = strGroupCol %in% names(dfAnalyzed)
domainName <- lWorkflow$group$domain | ||
data <- lData[[ domainName ]] | ||
columnName <- lMapping[[ domainName ]][[ lWorkflow$group$columnParam ]] | ||
strata <- data[[ columnName ]] %>% unique %>% sort |
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.
Unsure of the implications for workflow/how data will be passed to ZS, so this might be irrelevant.
Do we want to wrap this in if(length(strata) > 1
? Or maybe add a stopifnot()
requirement that the number of unique data[[ columnName ]] > 1
?
It does still work with a single unique strata value and returns:
Stratified workflow created for each level of dfPD$DVDECOD (n=1).
with a list value of StratifiedPD$pdCategory_1
Just noting this to avoid confusion to the end-user if they're expecting a stratified result and receive a single strata.
Co-authored-by: Matt Roumaya <40671730+mattroumaya@users.noreply.github.com>
Co-authored-by: Matt Roumaya <40671730+mattroumaya@users.noreply.github.com>
Co-authored-by: Matt Roumaya <40671730+mattroumaya@users.noreply.github.com>
Co-authored-by: Matt Roumaya <40671730+mattroumaya@users.noreply.github.com>
Merge branch 'dev' of github.com:Gilead-BioStats/gsm into fix-566 # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
Overview
Simple implementation of faceting for stratified analysis. Need to think about workflow updates to best implement in reports.
Test Notes/Sample Code