normalise_median: Median normalisation

View source: R/normalise.R

normalise_medianR Documentation

Median normalisation

Description

This function performs median normalisation on a numeric vector. It subtracts the median from each element in the vector and then divides the resulting values by the square root of the sum of their squared deviations from the median.

Usage

normalise_median(x, remove_na = TRUE)

Arguments

x

A numeric vector that will be normalised.

remove_na

Boolean indicating whether NA values should be removed. Defaults to TRUE.

Value

A numeric vector of the same length as x where each element has been positionally normalised.

Examples

normalise_median(c(1, 2, 3, 4, 5))
normalise_median(c(10, 20, 30, 40, 50))


britishredcrosssociety/compositr documentation built on Nov. 4, 2024, 5:21 p.m.