View source: R/sequence_characteristics.R
scale_to_reference_peak_frequency | R Documentation |
Scale values so that the frequency of values < max(reference values) is the same as the frequency of reference values < max(reference values)
scale_to_reference_peak_frequency(x, x_ref, cap_at_peak = FALSE, na.rm = FALSE)
x |
Numeric vector. Values to scale. |
x_ref |
Numeric vector. Values from which the reference value is calculated. |
cap_at_peak |
A logical value. If |
na.rm |
A logical value. Argument is passed to |
A numeric vector of the same length as x
.
scale_to_reference_fun
x <- c(
0.685, 0.698, 0.717, 1.026, 1.216, 1.239, 1.123, 1.104, 0.999,
0.81, 0.652, 0.633
)
x0 <- c(0.5, 0.5, 0.5, 0.7, 0.9, 1, 1, 1, 0.9, 0.7, 0.5, 0.5)
x_scaled1 <- scale_to_reference_peak_frequency(x, x0, cap_at_peak = TRUE)
print(x_scaled1)
x_scaled2 <- scale_to_reference_peak_frequency(x, x0)
squash_into_low_high(x_scaled2, val_low = -Inf, val_high = max(x0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.