Learn R Programming

plgp (version 1.0)

rectscale: Un/Scale data in a bounding rectangle

Description

Scale data lying in an arbitrary rectangle to lie in the unit rectangle, and back again

Usage

rectscale(X, rect)
rectunscale(X, rect)

Arguments

X
a matrix or data.frame of real-valued covariates
rect
a matrix describing a bounding rectangle for X with 2 columns and ncol(X) rows

Value

  • a matrix or data.frame with the same dimensions as X scaled or un-scaled as appropriate

References

http://www.statslab.cam.ac.uk/~bobby/plgp.html

Examples

Run this code
X <- matrix(runif(10, 1, 3), ncol=2)
rect <- rbind(c(1,3), c(1,3))
Xs <- rectscale(X, rect)
rectunscale(Xs, rect)

Run the code above in your browser using DataLab