range2: Range of values

Description Usage Arguments Details Value Examples

View source: R/range2.R

Description

Wrapper around the base R range() function that allows to expand the width of the range.

Usage

1
range2(..., n = 1, na.rm = FALSE)

Arguments

...

Any numeric or character objects.

n

Positive numeric single value indicating the factor we wish to reduce (n < 1) or extand (x > 1) the range.

na.rm

Logical indicating if NAs should be omitted.

Details

The range is reduced or extended symetrically, both sides of the current range.

Value

Same output as the base R range() function.

Examples

1
2
3
4
5
x <- rnorm(100)
range(x)
range2(x, n = 2)
diff(range2(x, n = 2)) / 2
diff(range2(x, n = .5)) / .5

choisy/mcstats documentation built on May 21, 2019, 3:08 a.m.