Skip to contents

A function to return the cumulative range of a vector.

Usage

crange(.x)

Arguments

.x

A numeric vector

Value

A numeric vector

Details

A function to return the cumulative range of a vector. It uses max(.x[1:k]) - min(.x[1:k]) as the basis of the function.

See also

Other Vector Function: cgmean(), chmean(), ckurtosis(), cmean(), cmedian(), csd(), cskewness(), cvar(), euclidean_distance(), kurtosis_vec(), rw_range(), skewness_vec()

Author

Steven P. Sanderson II, MPH

Examples


x <- mtcars$mpg

crange(x)
#>  [1]  0.0  0.0  1.8  1.8  4.1  4.7  8.5 10.1 10.1 10.1 10.1 10.1 10.1 10.1 14.0
#> [16] 14.0 14.0 22.0 22.0 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5 23.5
#> [31] 23.5 23.5