Skip to content

Commit

Permalink
Argument passing to scale()
Browse files Browse the repository at this point in the history
  • Loading branch information
robjhyndman committed Sep 17, 2024
1 parent 0112e00 commit 0669ef6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/mvscale.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ mvscale <- function(object, center = stats::median, scale = robustbase::s_Qn,
}
# Create more resilient version of scale function
if(!is.null(scale)) {
my_scale <- function(x, mu.too = FALSE, na.rm = TRUE) {
s <- scale(x, mu.too = mu.too, na.rm = na.rm)
my_scale <- function(x, ..., na.rm = TRUE) {
s <- scale(x, ..., na.rm = na.rm)
s[s == 0] <- 1 # Avoid division by zero
return(s)
}
Expand Down

0 comments on commit 0669ef6

Please sign in to comment.