View source: R/utils_normalization.R
denormalize | R Documentation |
Convert normalized data back to original scale using given min and max.
denormalize(x, min, max)
x |
Numeric vector that has been normalized (values is between 0 and 1). |
min |
The minimum value of the original data. |
max |
The maximum value of the original data. |
A numeric vector already converted to original scale.
# Example of the original data
original_data <- c(10, 20, 30, 40, 50)
# Data being normalized
normalized_data <- (original_data - min(original_data)) /
(max(original_data) - min(original_data))
# Denormalization function use to change value to the original
denormalize(normalized_data, min(original_data), max(original_data))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.