dat2poly: Create n-degree polynomial from data frame

View source: R/dat2poly.R

dat2polyR Documentation

Create n-degree polynomial from data frame

Description

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

Usage

dat2poly(
  dat,
  method = c("simple", "poly"),
  degree = 2,
  raw = FALSE,
  as.data.frame = TRUE
)

Arguments

dat

Numeric, matrix / data.frame: Input

method

Character: "simple", "poly". "simple": raise each column of dat up to degree. "poly": use stats::poly with arguments degree and raw

degree

Integer: degree of polynomials to create. Default = 2

raw

Logical: If TRUE, create simple polynomial, not orthogonalized. Default = FALSE

as.data.frame

Logical: If TRUE, return data.frame. Default = TRUE

Author(s)

E.D. Gennatas


egenn/rtemis documentation built on Dec. 17, 2024, 6:16 p.m.