mvp | R Documentation |
Create, test for, an coerce to, mvp
objects
mvp(vars, powers, coeffs)
is_ok_mvp(vars,powers,coeffs)
is.mvp(x)
as.mvp(x)
## S3 method for class 'character'
as.mvp(x)
## S3 method for class 'list'
as.mvp(x)
## S3 method for class 'mpoly'
as.mvp(x)
## S3 method for class 'mvp'
as.mvp(x)
## S3 method for class 'numeric'
as.mvp(x)
vars |
List of variables comprising each term of an |
powers |
List of powers corresponding to the variables of the
|
coeffs |
Numeric vector corresponding to the coefficients to each
element of the |
x |
Object to be coerced to or tested for being class |
Function mvp()
is the formal creation mechanism for mvp
objects. However, it is not very user-friendly; it is better to use
as.mvp()
in day-to-day use.
Function is_ok_mvp()
checks for consistency of its arguments.
Robin K. S. Hankin
mvp(list("x", c("x","y"), "a", c("y","x")), list(1,1:2,3,c(-1,4)), 1:4)
## Note how the terms appear in an arbitrary order, as do
## the symbols within a term.
kahle <- mvp(
vars = split(cbind(letters,letters[c(26,1:25)]),rep(seq_len(26),each=2)),
powers = rep(list(1:2),26),
coeffs = 1:26
)
kahle
## again note arbitrary order of terms and symbols within a term
## Standard arithmetic rules apply:
a <- as.mvp("1 + 4*x*y + 7*z")
b <- as.mvp("-7*z + 3*x^34 - 2*z*x")
a+b
a*b^2
(a+b)*(a-b) == a^2-b^2 # should be TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.