truncate_vector: Truncate a vector on one/both sides

Description Usage Arguments Value Author(s) Examples

View source: R/truncate_vector.R

Description

Truncate (or trim) a vector on one or both sides, by user defined percentages

Usage

1
truncate_vector(Vector, pct_trunc_left = 10, pct_trunc_right = 10)

Arguments

Vector

A vector of numerical values

pct_trunc_left

A number denoting the percentage to truncate from left. For 10% enter 10.

pct_trunc_right

A number denoting the percentage to truncate from right. For 10% enter 10.

Value

Returns a truncated vector

Author(s)

Subhrangshu Nandi, PhD Statistics, UW Madison; snandi@wisc.edu or nands31@gmail.com

Examples

1
2
vector <- c(2, 3, 5, 2, 1, 2, 3, 5, 2, 1, 2, 3, 5, 2, 1, 2, 3, 5, 2, 1, 2, 3, 5, 2, 1)
truncate_vector(vector, 5, 5)

snandi/RFunctionsSN documentation built on May 30, 2019, 5:04 a.m.