Learn R Programming

plgraphics (version 1.2)

clipat: Clip Data Outside a Range

Description

Drop values outside a given range

Usage

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

Value

As the input x, with pertinent elements dropped or replaced

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".

Author

Werner A, Stahel

Examples

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

Run the code above in your browser using DataLab