poly_rescale {polypoly} | R Documentation |
Rescale the range of a polynomial matrix
Description
Rescale the range of a polynomial matrix
Usage
poly_rescale(x, scale_width = 1)
Arguments
x |
a matrix created by |
scale_width |
the desired range (max - min) for the first column of the matrix |
Details
This function strips away the poly
class and the coefs
attribute of the matrix. This is because those attributes no longer
describe the transformed matrix.
Value
the rescaled polynomial matrix (as a plain matrix with coefs
attribute removed)
Examples
m <- poly(1:10, degree = 4)
# Difference between min and max values of first column is 10
scaled <- poly_rescale(m, scale_width = 10)
scaled
# Rescaled values are still orthogonal
zapsmall(cor(scaled))
[Package polypoly version 0.0.3 Index]