polynomializer: Create exponentiated vectors.

Description Usage Arguments Value Author(s)

View source: R/polynomializer.R

Description

Exponentiate vectors to make polynomials of degree 2 to degree.

E.g. create columns v^2, v^3, v^4...

Usage

1
2
polynomializer(data, cols = NULL, degree = 3, suffix = "_",
  up_to = TRUE)

Arguments

data

Dataframe or Vector.

cols

Names of columns to "polynomialize". (Character Vector)

Only specify if data is dataframe.

degree

Degree of the polynomial. Up to and including.

suffix

String to go after original name of column. Always followed by the exponent used. (Character)

up_to

Create polynomials up to degree. (Logical)

Value

Dataframe with added exponentiated columns.

Author(s)

Ludvig Renbo Olsen, [email protected]


LudvigOlsen/LRO.utilities documentation built on May 27, 2018, 4:21 p.m.