Learn R Programming

snapKrig (version 0.0.2)

as.matrix.sk: 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 sk
as.matrix(x, rownames.force = NA, layer = 1, ...)

Value

the grid data as a matrix

Arguments

x

a sk object

rownames.force

ignored

layer

integer, for multi-layer grids, the layer number to return

...

further arguments to as.matrix

Examples

Run this code
g = sk_validate(list(gval=stats::rnorm(4^2), gdim=4, gres=0.5))
plot(g)
as.matrix(g)

Run the code above in your browser using DataLab