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

Fix #747 - Remove N from Assess() Functions #753

Merged
merged 8 commits into from
Sep 23, 2022
Merged

Fix #747 - Remove N from Assess() Functions #753

merged 8 commits into from
Sep 23, 2022

Conversation

collleenmclaughlin
Copy link
Contributor

Updated Supporting Functions for Assess() Functions to Remove $N

Related Issue: #747
Changes affect AE_Assess(), Consent_Assess(), Disp_Assess(), IE_Assess(), LB_Assess(), and PD_Assess() functions

Updates Made:

  • Analyze_Fisher.R, Analyze_Poisson.R, Summarize.R - removed N from stopifnot section and from select()
  • Visualize_Score.R - removed sum(dfFlagged$N) / sum(dfFlagged$TotalCount)
  • Transform_Count.R, Transform_Rank.R - removed N from summarize()

Test Notes:

Once codes above were updated, I ran the codes under @examples in respective Assess() function

Copy link
Contributor

@mattroumaya mattroumaya left a comment

Choose a reason for hiding this comment

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

This looks great, @collleenmclaughlin!

Just a few minor tweaks noted in the review and below:

  • Take a look at the documentation and make sure to remove the references to N (like seen here).
  • After you've removed the references to N in the documentation, be sure to run devtools::document() to update the documentation, and then commit and push those changes.

Comment on lines 69 to 71
if (all(c("Numerator", "Denominator") %in% names(dfFlagged))) {
sum(dfFlagged$Numerator) / sum(dfFlagged$Denominator)
} else {
sum(dfFlagged$N) / sum(dfFlagged$TotalCount)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since dfFlagged across all assessments should now contain Numerator and Denominator, we should take out the ifelse and replace with:

yintercept = sum(dfFlagged$Numerator) / sum(dfFlagged$Denominator)

@@ -50,7 +50,7 @@ Analyze_Fisher <- function(
) {
stopifnot(
"dfTransformed is not a data.frame" = is.data.frame(dfTransformed),
"One or more of these columns: GroupID, N, or the value in strOutcome not found in dfTransformed" = all(c("GroupID", "N", strOutcome) %in% names(dfTransformed)),
"One or more of these columns: GroupID, or the value in strOutcome not found in dfTransformed" = all(c("GroupID", strOutcome) %in% names(dfTransformed)),
Copy link
Contributor

Choose a reason for hiding this comment

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

Very minor suggestion, but as we've removed variables, it might be good to change to:

"GroupID or the value found in strOutcome not found in dfTransformed"

Copy link
Contributor

@mattroumaya mattroumaya left a comment

Choose a reason for hiding this comment

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

Great work @collleenmclaughlin!

@mattroumaya mattroumaya merged commit deb5638 into dev Sep 23, 2022
@mattroumaya mattroumaya deleted the fix-747 branch September 23, 2022 21:47
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.

2 participants