central: Generate central values of a varaible

centralR Documentation

Generate central values of a varaible

Description

Function generates central values of a variable. If the variable is numeric with more than n_unique_fac values, then the median is returned. If the variable is a factor or numeric with fewer than or equal to n_unique_fac unique values, then the modal value is returned.

Usage

central(x, n_unique_fac = 10, ...)

Arguments

x

A vector of values.

n_unique_fac

number of unique values below which the variable will be treated like a factor.

...

currently unimplemented.

Value

A scalar value giving the central value of the variable.


davidaarmstrong/damisc documentation built on Oct. 1, 2023, 3:05 p.m.