-
Notifications
You must be signed in to change notification settings - Fork 0
⚡ Bolt: stats::na.omit() 사용 배제를 통한 결측치 카운트 로직 최적화 #303
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
98d4897
3b5f6b7
5abc487
39fec12
3063419
e7d4536
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,7 +83,7 @@ surveyFA <- function( | |
| response_data <- as.data.frame(data) | ||
| response_data <- | ||
| response_data[, vapply(response_data, function(column) { | ||
| nunique <- length(unique(stats::na.omit(column))) | ||
| nunique <- sum(!is.na(unique(column))) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: na.omit replacement is numerically equivalent Rewriting Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| nunique >= 2L | ||
| }, logical(1L))] | ||
|
|
||
|
|
||
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.
📝 Info: Regression guard pins the pre-refactor idiom
The category-count guard in test-optimization-equivalence.R still pins
length(na.omit(unique(x))), while the source now usessum(!is.na(unique(x))). The two are equivalent for atomic vectors, so behavior is unchanged, but the guard no longer mirrors the implementation and will not catch a future change to the new idiom.Was this helpful? React with 👍 or 👎 to provide feedback.