rescale_11: rescale vectors to [-1,1]

Description Usage Arguments Details Value See Also

Description

rescale_11 rescales every vector in a list of vectors to the range [-1, 1]. rescale_11 rescales the vectors as a group (instead of rescaling each vector independently). This is a helpful feature for rescaling related variables (such as xmin and xmax) without nullifying the difference between the two.

Usage

1
  rescale_11(xvars, xlim = NULL)

Arguments

xvars

a list of vectors

xlim

NULL (default) or a numeric vector of length two that specifies the range of values to scale to [-1, 1]

Details

If a vector is a character or factor vector, rescale_11 attempts to coerce it to numeric before scaling. The scale is determined by finding the range of values contained in the list of vectors and mapping it ot [-1, 1].

If the full range of values to be scaled is not present in the vectors, users can specify the range to be scaled to [-1,1] with the xlim argument. Values in the vectors will be rescaled as if they according to this range.

Value

a list of vectors

See Also

rescale_01, rescale_2pi


garrettgman/ggplyr documentation built on May 16, 2019, 5:38 p.m.