Learn R Programming

ClamR (version 2.1-3)

RESCALE: Rescale a vector to fit in a certain range

Description

Rescale a vector to fit in a certain range

Usage

RESCALE(x, nx1, nx2, minx, maxx)

Value

scale vector is returned

Arguments

x

vector

nx1

new minimum

nx2

new maximum

minx

old min

maxx

old max

Author

Jonathan M. Lees<jonathan.lees.edu>

Details

Used for graphics.

Examples

Run this code
x = rnorm(10)
RESCALE(x, 3, 9, min(x), max(x) )

Run the code above in your browser using DataLab