as.matrix.sk {snapKrig} | R Documentation |
convert to matrix
Description
Returns a matrix representation of the grid data. This is shorthand for
extracting the data using x[]
(single layer) or x[,j]
(multi-layer),
then passing the result to matrix
along with dim(x)
.
Usage
## S3 method for class 'sk'
as.matrix(x, rownames.force = NA, layer = 1, ...)
Arguments
x |
a sk object |
rownames.force |
ignored |
layer |
integer, for multi-layer grids, the layer number to return |
... |
further arguments to as.matrix |
Value
the grid data as a matrix
Examples
g = sk_validate(list(gval=stats::rnorm(4^2), gdim=4, gres=0.5))
plot(g)
as.matrix(g)
[Package snapKrig version 0.0.2 Index]