View source: R/augment-hai-windorized-move.R
hai_winsorized_move_augment | R Documentation |
Takes a numeric vector and will return a tibble with the winsorized values.
hai_winsorized_move_augment(.data, .value, .multiple, .names = "auto")
.data |
The data being passed that will be augmented by the function. |
.value |
This is passed |
.multiple |
A positive number indicating how many times the the zero center mean absolute deviation should be multiplied by for the scaling parameter. |
.names |
The default is "auto" |
Takes a numeric vector and will return a winsorized vector of values that have been moved some multiple from the mean absolute deviation zero center of some vector. The intent of winsorization is to limit the effect of extreme values.
An augmented tibble
Steven P. Sanderson II, MPH
https://en.wikipedia.org/wiki/Winsorizing
Other Augment Function:
hai_fourier_augment()
,
hai_fourier_discrete_augment()
,
hai_hyperbolic_augment()
,
hai_polynomial_augment()
,
hai_scale_zero_one_augment()
,
hai_scale_zscore_augment()
,
hai_winsorized_truncate_augment()
suppressPackageStartupMessages(library(dplyr))
len_out <- 24
by_unit <- "month"
start_date <- as.Date("2021-01-01")
data_tbl <- tibble(
date_col = seq.Date(from = start_date, length.out = len_out, by = by_unit),
a = rnorm(len_out),
b = runif(len_out)
)
hai_winsorized_move_augment(data_tbl, a, .multiple = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.