squish: Squish values into range.

Description Usage Arguments Author(s) Examples

View source: R/bounds.r

Description

Squish values into range.

Usage

1
squish(x, range = c(0, 1), only.finite = TRUE)

Arguments

x

numeric vector of values to manipulate.

range

numeric vector of length two giving desired output range.

only.finite

if TRUE (the default), will only modify finite values.

Author(s)

Homer Strong [email protected]

Examples

1
2
squish(c(-1, 0.5, 1, 2, NA))
squish(c(-1, 0, 0.5, 1, 2))

Example output

[1] 0.0 0.5 1.0 1.0  NA
[1] 0.0 0.0 0.5 1.0 1.0

scales documentation built on Aug. 10, 2018, 1:17 a.m.