-
-
Notifications
You must be signed in to change notification settings - Fork 22
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 s_summary
return for empty logical vectors
#1079
Conversation
Code Coverage Summary
Diff against main
Results for commit: 918d6fd Minimum allowed coverage is ♻️ This comment has been updated with latest results |
@@ -410,7 +414,7 @@ s_summary.logical <- function(x, | |||
N_col = .N_col | |||
) | |||
y$count <- count | |||
y$count_fraction <- c(count, ifelse(dn > 0, count / dn, NA)) |
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.
it should be inf btw ahah
No I was wondering if we want 0 as std here. I think it is better to have NA and then use na_str to set it to NE, right? or I am missing something?
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.
Hi @Melkiades, as per Tim's comment on the issue (#649 (comment)) for counts and percentages (3.1.1) "0" should be returned when denominator is zero. This change aligns the logical output with the factor/character output as expected.
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.
Lgtm! Thanks, Emily for rectifying this!
Pull Request
Fixes #649
Outputting
NE
instead ofNA
will be enabled by #1071.