Description Usage Arguments Value Examples
View source: R/load_and_reshape.R
Given a file path to a SAR raster image
in tif
format, convert the 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
. This function
uses array_reshape
with
default order = "C"
, meaning
that elements are read during
rearrangement in row-major order, so
that the last index changes the fastest.
1 2 3 4 5 6 | load_SAR_matrix(
filename,
drop_na = TRUE,
na_layer = 1L,
set_na_indices = integer(0)
)
|
filename |
This is usually a string giving absolute or relative
path to a |
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 | filename <- system.file(
"extdata", "MG_CC_sub_norm_testclip.tif", package="rsar")
load_SAR_matrix(filename)
load_SAR_matrix(filename, set_na_indices = c(1,2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.