clipat: Clip Data Outside a Range

View source: R/general.R

clipatR Documentation

Clip Data Outside a Range

Description

Drop values outside a given range

Usage

clipat(x, range=NULL, clipped=NULL)

Arguments

x

vector of data to be clipped at range

range

range, a numerical vector of 2 elements

clipped

if NULL, the clipped data will be dropped. Otherwise, they will be replaced by clipped, which is typically set to NA. If clipped is numerical of length 2, the elements of x clipped below are set to clipped[1], those clipped by range[2], by clipped[2]. Therefore, if clipped equals range, x will be "Winsorized".

Value

As the input x, with pertinent elements dropped or replaced

Author(s)

Werner A, Stahel

Examples

clipat(rnorm(10,8,2), c(10,20), clipped=NA)

plgraphics documentation built on Oct. 19, 2023, 3 p.m.