Learn R Programming

FRAPO (version 0.3-7)

capser: Capping a series to bounds

Description

The values of a series that are absolute greater than min and/or max are capped to these specified values.

Usage

capser(y, min, max)

Arguments

y
Objects of classes: numeric, matrix, data.frame, ts, mts, timeSeries, zoo and xts are supported.
min
Numeric, minimum value for the series.
max
Numeric, maximim value for the series.

Value

  • An object of the same class as y, containing the truncated series.

concept

  • capping
  • bounding
  • truncating

See Also

trdbilson, trdbinary, trdes, trdhp, trdsma, trdwma

Examples

Run this code
data(StockIndex)
y <- StockIndex[, "SP500"]
cs <- capser(y, min = 100, max = 200)
head(cs)

Run the code above in your browser using DataLab