rangeit: Range data between 0 and 1

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/rangeit.R

Description

Re-scale the data to lie between 0 and 1

Usage

1
rangeit(x, na.rm = TRUE)

Arguments

x

Data vector to be ranged.

na.rm

Logical; should NA-values be ignored when computing min and max? Defaults to TRUE.

Details

A trivial function to re-scale data by subtracting the min and dividing by the difference between max and min. This function does not change the shape of the distribution.

Value

a vector of same length as x

Author(s)

Carsten F. Dormann <carsten.dormann@biom.uni-freiburg.de>

See Also

scale

Examples

1
2
3
4
5
blubb <- rnorm(100, sd=15)
par(mfrow=c(1,2))
hist(blubb)
hist(rangeit(blubb))
par(mfrow=c(1,1))

biometry/phenologicalOverlap documentation built on May 21, 2019, 2:31 a.m.