demean-demedian: Removes measure of centrality from the series

Description Usage Arguments Value Examples

Description

Maturing lifecycle

Removes the mean, the median or the mode from the series.

Usage

1
2
3
4
5
demean(x, na.rm = getOption("transx.na.rm"))

demedian(x, na.rm = getOption("transx.na.rm"))

demode(x, na.rm = getOption("transx.na.rm"))

Arguments

x

[univariate vector]

Univariate vector, numeric or ts object with only one dimension.

na.rm

[logical(1): getOption("transx.na.rm")]

A value indicating whether NA values should be stripped before the computation proceeds.

Value

Returns a vector with the same class and attributes as the input vector.

Examples

1
2
3
4
5
6
x <- c(2,5,10,20,30)
summary(x)

demean(x)
demedian(x)
demode(x)

kvasilopoulos/transx documentation built on Jan. 26, 2021, 6:14 p.m.