Description Usage Arguments Details Value Examples
Functions to create, coerce and check for polynomials.
1 2 3 | polynomial(length = 0)
as.polynomial(x, exponents = NULL, ...)
is.polynomial(x)
|
length |
A non-negative integer specifying the desired length. Double values will be coerced to integer: supplying an argument of length other than one is an error. |
x |
object to be coerced or tested. |
exponents |
|
... |
further arguments passed to |
polynomial creates a double-precision vector of the specified length with
each coefficient equal to 0 and exponents equal to
seq(0L, length.out = length).
as.polynomial returns x if x is a polynomial. If
not, it attempts to coerce its argument to be of double or complex type: most
attributes will be stripped (excluding dim, dimnames
and names). Finally, the "class" and "exponents"
attibutes are populated.
polynomial and as.polynomial both return polynomial objects.
is.polynomial returns TRUE or FALSE depending on whether
its argument is a polynomial or not.
1 2 3 4 5 6 7 | as.polynomial(c(0, 4, 2, -1))
## 'as.polynomial' reduces complex numbers to real numbers if appropriate.
## You can use 'strict = FALSE' to stop this conversion.
as.polynomial(complex(real = c(0, 4, 2, -1)))
as.polynomial(complex(real = c(0, 4, 2, -1)), strict = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.