hloc: High, Low, Open, and Close Calculation

Description Usage Arguments Value See Also Examples

Description

Calculates the high, low, first, and last elements of a vector. Especially useful for financial trading data in conjunction with the aggregateSeries function.

Usage

1
hloc(x)

Arguments

x

a vector for which to calculate high, low, open, and close.

Value

returns a vector with four elements:

the maximum value in x.

the minimum value in x.

the first value of x.

the last value of x.

x can be an array, but dimensions are ignored.

See Also

aggregateSeries.

Examples

1
2
x <- c(5, 2, 3, 6, 3, 2, 1, 7, 1) 
hloc(x) 

splusTimeSeries documentation built on April 30, 2021, 5:09 p.m.