Learn R Programming

scales (version 0.1.0)

squish: Squish values into range.

Description

Squish values into range.

Usage

squish(x, range = c(0, 1))

Arguments

x
numeric vector of values to manipulate.
range
numeric vector of length two giving desired output range.

Examples

Run this code
squish(c(-1, 0.5, 1, 2, NA))
squish(c(-1, 0, 0.5, 1, 2))

Run the code above in your browser using DataLab