univariate_trim: Trim extreme quantiles from a variable.

View source: R/univariate-trim.R

univariate_trimR Documentation

Trim extreme quantiles from a variable.

Description

Replaces extreme values with NA values.

Usage

univariate_trim(scores, quantile_lower = 0, quantile_upper = 1)

Arguments

scores

A vector of values that quantile() can accept.

quantile_lower

The lower inclusive bound of values to retain.

quantile_upper

The upper inclusive bound of values to retain.

Value

Returns a vector of the same class as scores.

Examples

#Exclude the largest 5%
TabularManifest::univariate_trim(scores=datasets::beaver1$temp,
  quantile_lower=0, quantile_upper=.95)

#Exclude the largest 5% and the smallest 5%
TabularManifest::univariate_trim(scores=datasets::beaver1$temp,
  quantile_lower=.05, quantile_upper=.95)

Melinae/TabularManifest documentation built on Dec. 11, 2023, 1:48 a.m.