Learn R Programming

sivipm (version 1.1-4.2)

takeoff.polyX: Remove Monomials from a polyX Object

Description

Remove monomials from an object of class '>polyX.

Usage

# S4 method for polyX
takeoff(P, monomials)

Arguments

P

Object of class '>polyX.

monomials

Integer or character vector. The monomials to be removed. When integer, the numbers of the monomials. When character, their expression using the variable names and the character "*" to denote interaction.

Value

An object of class '>polyX.

See Also

bind.polyX

Examples

Run this code
# NOT RUN {
X <- cornell0[,1:2] # X-inputs
# Polynomial creation
monomials <- c("Distillation","Reformat","Distillation*Reformat")
P <- vect2polyX (X, monomials)
# Remove the third  monomial:
P2 <- takeoff(P, c(3))
# Same expressed with using variable names:
P2 <- takeoff(P, c("Distillation*Reformat"))
# }

Run the code above in your browser using DataLab