scale_Grid: Scale a 'Grid' object.

View source: R/miscUtils.R

scale_GridR Documentation

Scale a Grid object.

Description

Scale a Grid object.

Usage

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

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))


IRSN/smint documentation built on Dec. 9, 2023, 9:53 p.m.