View source: R/e_scale_align.R
e_scale_align | R Documentation |
Align the distribution of one empirical distribution to an empirical reference distribution
e_scale_align(
var_to_scale = NULL,
var_ref = NULL,
scale_method = c("quantile", "zscore")[1],
quantiles_to_match = c(0.1, 0.9),
sw_plot = c(TRUE, FALSE)[2]
)
var_to_scale |
Variable to rescale |
var_ref |
Reference variable distribution |
scale_method |
Method of rescaling. |
quantiles_to_match |
For |
sw_plot |
T/F to plot Reference, Original, and Scaled variables. |
var_scaled Scaled vector (NAs have been removed)
set.seed(76543)
e_scale_align(
var_to_scale = c(NA, rgamma( 40, shape = 3, rate = 2) + 4, NA)
, var_ref = rgamma(100, shape = 3, rate = 1)
, scale_method = c("quantile", "zscore")[1]
, quantiles_to_match = c(0.1, 0.9)
, sw_plot = c(TRUE, FALSE)[1]
)
set.seed(76543)
e_scale_align(
var_to_scale = c(NA, rgamma( 40, shape = 3, rate = 2) + 4, NA)
, var_ref = rgamma(100, shape = 3, rate = 1)
, scale_method = c("quantile", "zscore")[2]
, sw_plot = c(TRUE, FALSE)[1]
)
# Scale to c(0, 1) bounded
e_scale_align(
var_to_scale = rnorm(100) |> sort()
, var_ref = c(0, 1)
, scale_method = c("quantile", "zscore")[1]
, quantiles_to_match = c(0, 1)
, sw_plot = c(TRUE, FALSE)[2]
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.