scale_Grid: Scale a 'Grid' object.

Description Usage Arguments Value See Also Examples

Description

Scale a Grid object.

Usage

1
scale_Grid(X, fromRange = range_Grid(X), toRange = c(0, 1))

Arguments

X

An object with class "Grid" or which can be coerced into this class.

fromRange

A numeric vector of length 2 (min and max) or a matrix with 2 rows (min an max) and one column for each grid dimension in X. This object gives the original "old" range.

toRange

A numeric vector of length 2 (min and max) or a matrix with 2 rows (min an max) and one column for each grid dimension in X.This object gives the target "new" range replacing the old one.

Value

An object with the same class as X but with the each levels rescaled.

See Also

range_Grid.

Examples

1
2
3
4
myGD <- Grid(levels = list(x = c(1, 3, 10), y = c(0, 1000, 2000, 3000)))
scale_Grid(myGD)
scale_Grid(as.matrix(myGD))
scale_Grid(as.data.frame(myGD))

smint documentation built on April 14, 2017, 1:49 p.m.