standardise: Standardise values

View source: R/standardise.R

standardiseR Documentation

Standardise values

Description

Standardise values

Usage

standardise(x, grouping, min_valid, max_na, m = 0, sd = 1)

Arguments

x

A vector

grouping

A variable with group values for calculating grouped centered.

min_valid

Minimal number of valid values that is requiered for calculation. A value between 0 and 1 indicates a proportion of values (e.g., 0.5 = 50 percent of values have to be valid).

max_na

Maximum number of NAs that are allowed before returning NA. A value between 0 and 1 indicates a proportion of values (e.g., 0.5 = 50 percent NAs are allowed).

m

Mean after standardisation (default = 0)

sd

Mean after standardisation (default = 1)

Examples

standardise( c(1:9, NA, NA, NA, NA, NA), m = 100, sd = 15)
standardise( c(1:95, NA, NA, NA, NA, NA), min_valid = 0.96)

jazznbass/wmisc documentation built on Oct. 29, 2024, 5:42 p.m.