This is a convenience function that will take each column of the input and calculate 1:degree powers and concatenate into a data.frame of dimensions `n * (degree * p)` given an `n * p` input
dat2poly(dat, method = c("simple", "poly"), degree = 2, raw = FALSE,
as.data.frame = TRUE)
Numeric, matrix / data.frame: Input
String: "simple", "poly". "simple": raise each column of dat
up to degree
.
"poly": use stats::poly
with arguments degree
and raw
Integer: degree of polynomials to create. Default = 2
Logical: If TRUE, create simple polynomial, not orthogonalized. Default = FALSE
Logical: If TRUE, return data.frame. Default = TRUE