Skip to contents

This function takes a vector x and normalizes it to a specified quantile. The normalization is done by subtracting the minimum value of x and dividing the result by the specified quantile of x. Values greater than 1 are capped at 1.

Usage

norm0q(x, quant = 0.99)

Arguments

x

A numeric vector to be normalized

quant

The quantile to normalize to (default is 0.99)

Value

A normalized vector

Examples

x <- rnorm(100)
normed_x <- norm0q(x)

range(normed_x) # This should show values between 0 and 1
#> [1] 0 1