newRange: Define a new range for a numeric

View source: R/newRange.R

newRangeR Documentation

Define a new range for a numeric

Description

The newRange function scales a numeric vector to a new range as defined by minimum and maximum extreme values.

Usage

newRange(x, new.min = 0, new.max = 1)

Arguments

x

a numeric vector

new.min

numeric value of new minimum range value

new.max

numeric value of new maximum range value

Examples

y <- runif(100, min=0, max=2)
y2 <- newRange(y, new.min=0, new.max=1)
plot(y, t="l")
lines(y2, col=2)

plot(y, y2)


marchtaylor/sinkr documentation built on July 4, 2022, 5:48 p.m.