Description Usage Arguments Value Examples
View source: R/load_and_reshape.R
Convert a raster brick
of
dimensions A x B x C
into a matrix of
dimensions A*B x C
while keeping
track of the geospatial and dimension attributes of the
original brick.
1 | brick_to_matrix(b, drop_na = TRUE, na_layer = 1L, set_na_indices = integer(0))
|
b |
A raster |
drop_na |
A logical. If |
na_layer |
An integer specifying the index of the
layer to check for |
set_na_indices |
Optional integer vector specifying a
vector of row indices in the |
An object of class SAR_matrix
; a specialisation
of class matrix.
1 2 3 4 5 | filename <- system.file(
"extdata", "MG_CC_sub_norm_testclip.tif", package="rsar")
b <- raster::brick(filename)
m1 <- brick_to_matrix(b)
m2 <- brick_to_matrix( b, set_na_indices = c(1,2) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.