Learn R Programming

useful (version 1.2.6)

MapToInterval: Map numbers to interval

Description

Maps a range of numbers to a given interval

Usage

MapToInterval(nums, start = 1, stop = 10)

Value

The original numbers mapped to the given interval

Arguments

nums

The vector of numbers to be mapped

start

The start of the interval

stop

The end of the interval

Author

Jared P. Lander www.jaredlander.com

Details

formula: a + (x - min(x)) * (b - a) / (max(x) - min(x))

See Also

mapping

Examples

Run this code

MapToInterval(1:10, start=0, stop=1)
mapping(1:10, start=0, stop=1)

Run the code above in your browser using DataLab