View source: R/derivative5pointsStencil.R
| derivative5pointsStencil | R Documentation |
This module performs numerical differentiation using the five-point stencil method.
derivative5pointsStencil(x, y, n)
x |
a vector of values for x. |
y |
a vector of values for y. |
n |
order of numerical differentiation (n=1-4). |
A matrix of 2 columns. The first column represents x and the second column represents numerical differentiation values. This matrix has four rows (two rows from the beginning and 2 rows from the end) less than length of x or y.
data(peak_spline)
rt <- peak_spline[, 1]
int <- peak_spline[, 2]
n <- 2 # second order derivative
derivative5pointsStencil(rt, int, n)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.