Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Nov 14, 2023
1 parent 7e65584 commit 04ff86a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/data_rescale.R
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,7 @@ rescale.data.frame <- function(x,
}
# multiply? If yes, calculate the "add" value
if (!is.null(multiply)) {
x_range <- range(x, na.rm = TRUE)
x_diff <- diff(x_range)
add <- x_diff * (multiply - 1)
add <- diff(range(x, na.rm = TRUE)) * (multiply - 1)
}
# add?
if (!is.null(add)) {
Expand Down

0 comments on commit 04ff86a

Please sign in to comment.