View source: R/lsp_signature.R
lsp_signature | R Documentation |
Calculates selected spatial signatures based on categorical raster data. It also allows for calculations for any defined regular and irregular areas. It has several built-in signatures but also allows for any user-defined functions.
lsp_signature(
x,
type,
window = NULL,
neighbourhood = 4,
threshold = 0.9,
ordered = FALSE,
repeated = FALSE,
normalization = "pdf",
wecoma_fun = "mean",
wecoma_na_action = "replace",
classes = NULL
)
x |
Object of class |
type |
Type of the calculated signature. It can be |
window |
Specifies areas for analysis. It can be either: |
neighbourhood |
The number of directions in which cell adjacencies are considered as neighbours: 4 (rook's case) or 8 (queen's case). The default is 4. |
threshold |
The share of NA cells (0-1) to allow metrics calculation. |
ordered |
For |
repeated |
For |
normalization |
For |
wecoma_fun |
For |
wecoma_na_action |
For |
classes |
Which classes (categories) should be analyzed? This parameter expects a list of the same length as the number of attributes in |
Object of class lsp
.
It has three columns: (1) id
- an id of each window.
For irregular windows, it is the values provided in the window
argument,
(2) na_prop
- share (0-1) of NA
cells for each window,
(3) signature
- a list-column containing calculated signatures
library(stars)
landcover = read_stars(system.file("raster/landcover2015s.tif", package = "motif"))
landcover_coma = lsp_signature(landcover, type = "coma", threshold = 0.9, window = 2000)
landcover_coma
landcover_comp = lsp_signature(landcover, type = "composition", threshold = 0.9)
landcover_comp
# larger data example
library(stars)
landcover = read_stars(system.file("raster/landcover2015.tif", package = "motif"))
landcover_coma = lsp_signature(landcover, type = "coma", threshold = 0.9, window = 2000)
landcover_coma
landcover_comp = lsp_signature(landcover, type = "composition", threshold = 0.9)
landcover_comp
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.