Skip to content

Commit

Permalink
Remove unnecessary na.rm argument
Browse files Browse the repository at this point in the history
Signed-off-by: Liang Zhang <[email protected]>
  • Loading branch information
psychelzh committed Dec 25, 2023
1 parent f186769 commit b129c03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
10 changes: 4 additions & 6 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,13 @@ update_settings <- function(origin, updates) {
#' is considered as outlier. If set to `"cutoff"`, the any value out of
#' `threshold` range is considered as outlier.
#' @param threshold The threshold for determining whether a value is outlier or
#' not. For `"cutoff"` method, the default is `c(0.2, Inf)`. For `"z_score"`
#' method, the default is `2.5`.
#' @param na.rm A logical value indicating if `NA` values should be removed.
#' not. For `"transform"` and `"z_score"` method, the default is `2.5`. For
#' `"cutoff"` method, the default is `c(0.2, Inf)`.
#' @return A logical vector of the detected outliers.
#' @keywords internal
check_outliers_rt <- function(x,
method = c("transform", "z_score", "cutoff"),
threshold = NULL,
na.rm = TRUE) {
threshold = NULL) {
method <- match.arg(method)
if (is.null(threshold)) {
threshold <- switch(method,
Expand All @@ -230,7 +228,7 @@ check_outliers_rt <- function(x,
}
if (method == "transform") {
x <- x |>
scale(min(x, na.rm = na.rm), diff(range(x, na.rm = na.rm))) |>
scale(min(x, na.rm = TRUE), diff(range(x, na.rm = TRUE))) |>
sqrt()
}
switch(method,
Expand Down
9 changes: 3 additions & 6 deletions man/check_outliers_rt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b129c03

Please sign in to comment.