View source: R/Diff_GridOperator.R
1 | Diff_GridOperator(var = "x", grid_dataframe, h = 1)
|
var |
|
grid_dataframe |
|
h |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (var = "x", grid_dataframe, h = 1)
{
DeltaX = mean(diff(sort(unique(grid_dataframe[, "x"]))))
DeltaY = mean(diff(sort(unique(grid_dataframe[, "y"]))))
d <- approx_equals(as.matrix(dist(grid_dataframe)), c(x = DeltaX,
y = DeltaY)[var]) * 0.5 * outer(grid_dataframe[[var]],
grid_dataframe[[var]], "-")
diag(d) <- -colSums(d)
as(d/h, "dgCMatrix")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.