center: Mean center a variable

View source: R/center.R

centerR Documentation

Mean center a variable

Description

Mean center a variable

Usage

center(x, min_valid, max_na, grouping)

Arguments

x

A vector

min_valid

Minimal number of valid values that is required 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).

grouping

A variable with group values for calculating grouped centers.

Examples

center(c(1:10, NA, NaN))

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