derive.polynomial | R Documentation |
Methods for creating, evaluating, manupulating and displaying polynomial functions.
## S3 method for class 'polynomial' derive(x) ## S3 method for class 'spline' derive(x) ## S3 method for class 'polynomial' integrate(x) ## S3 method for class 'spline' integrate(x, n = 1) polynomial(beta) ## Default S3 method: polynomial(beta) ## S3 method for class 'polynomial' x + y ## S3 method for class 'polynomial' x - y ## S3 method for class 'polynomial' x * y ## S3 method for class 'polynomial' print(x) ## S3 method for class 'polynomial' coef(x)
x, y |
Polynomial object. |
beta |
Numeric vector of polynomial coefficients. First element is the constant coefficient, the second element is the linear coefficient, the third is the quadratic coefficient, etc... |
polynomial(default)
: Polynomial object creation and evaluation.
derive(polynomial)
: Polynomial derivation method.
integrate(polynomial)
: Polynomial integration method.
+
: Polynomial unary and binary addition operator.
-
: Polynomial unary and binary substraction operator.
*
: Polynomial multiplication operator.
print(polynomial)
: Polynomial print method.
coef(polynomial)
: Polynomial print method.
derive(spline)
: Spline derivation method.
integrate(spline)
: Spline integration method.
p1 <- polynomial(1:3) # Create polynomial 1 + 2*x + 3*x^2. p2 <- polynomial(0:5) # Create polynomial x + 2*x^2 + 3*x^3 + 4*x^4 + 5*x^5. # Evaluation: x <- 1:10 polynomial(1)(x) # Constant function. polynomial(c(1,0,2))(x) # Quadratic 1 + 2*x^2. p1(x) # Evaluate 'p1' at 'x'. (p1 + p2)(x) # Evaluate the sum of 'p1' and 'p2' at 'x'. (p1 - p2)(x) # Evaluate the difference of 'p1' and 'p2' at 'x'.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.