Ops.sk {snapKrig} | R Documentation |
Operations group generics
Description
Applies the operation point-wise to grid data values.
Usage
## S3 method for class 'sk'
Ops(e1, e2)
Arguments
e1 |
a "sk" object, vector or matrix |
e2 |
a "sk" object, vector or matrix |
Details
The function extracts the grid data x[]
from all sk class arguments x
, prior to
calling the default method. Before returning, the result is copied back to the grid object
of the second argument (or the first, if the second is not of class "sk").
Note that the compatibility of the two arguments is not checked beyond matching
dimension (with vectors recycled as needed). This means for example you can do
operations on two grids representing different areas, so long as they have the
same gdim
.
Value
a "sk" object (a copy of e1
or e2
) with modified data values
Examples
g = sk_validate(list(gval=stats::rnorm(4^2), gdim=4, gres=0.5))
# verify a trig identity using Ops and Math
summary( cos(g)^2 + sin(g)^2 )
# create a logical grid indicating points satisfying a condition
plot(g < 0)
all( !(g > 0) == (g[] < 0) )
# test negation
all( (-g)[] == -(g[]) )
[Package snapKrig version 0.0.2 Index]