Learn R Programming

sivipm (version 1.1-4.2)

vect2polyX: Create polyX Object from Polynomial Description

Description

Create an object of class '>polyX from a dataset of X-inputs and a vector that describes the polynomial.

Usage

vect2polyX(dataX, monomials)

Arguments

dataX

Raw X-inputs. A data.frame with as many rows as observations, and as many columns as variables.

monomials

Polynomial description. A character vector. Each element describes a monomial. The input variables are coded either by their numbers, or by their names. The character "*" denotes interaction between variables.

Value

An object of class '>polyX.

See Also

crpolyX, vect2polyXT

Examples

Run this code
# NOT RUN {
X <- cornell0[,1:3]
# Monomials expressed by variable numbers:
monomials <- c("1","2","3", "1*2*3")
polyXI <- vect2polyX (X, monomials)
# Monomials expressed by variable names:
monomials <- c("Distillation", "Reformat", "NaphthaT",
               "Distillation*Reformat*NaphthaT")
polyXI <- vect2polyX (X, monomials)
# }

Run the code above in your browser using DataLab