topcode: Top-coding values in a vector

Description Usage Arguments Details Value Examples

View source: R/topcode.R

Description

Top-coding values in a vector

Usage

1
topcode(x, probs = 0.99)

Arguments

x

numeric vector

probs

scalar of the quantile cut-point.

Details

This function sets all values larger than the selected quantile to the largest value of the remaining values.

Value

vector top-coded vector.

Examples

1
2
3
 x <- sort(rnorm(10))
 topcode(x)
 

sumtxt/datatools documentation built on Jan. 3, 2021, 1:39 a.m.