twRescale: twRescale

Description Usage Arguments Details Author(s)

Description

Rescale numeric vector to have specified minimum and maximum.

Usage

1
2
twRescale(x, to = c(0, 1), from = range(x[is.finite(x)], 
    na.rm = TRUE), clip = TRUE)

Arguments

x

data to rescale

to

range to scale to

from

range to scale from, defaults to range of data

clip

should values be clipped to specified range?

Details

adapted from package ggplot2 to avoid package redundancies

If from[1] == from[2] then the mean of interval to is returned.

Author(s)

Hadley Wickham <h.wickham@gmail.com>, Thomas Wutzler Thomas Wutzler


twMisc documentation built on May 2, 2019, 6:11 p.m.