View source: R/lsp_add_spatial.R
lsp_add_stars | R Documentation |
Creates or adds a stars object based on the input object or a set of parameters.
It accepts either an object of class stars
or lsp
.
In the first case, the output is created based on
the window
parameter.
In the second case, the output converts the lsp
object into
a stars
object.
lsp_add_stars(x = NULL, window = NULL, metadata = TRUE)
## Default S3 method:
lsp_add_stars(x = NULL, window = NULL, metadata = TRUE)
## S3 method for class 'lsp'
lsp_add_stars(x = NULL, window = NULL, metadata = TRUE)
x |
Object of class |
window |
Specifies areas for analysis. It can be either: |
metadata |
Logical. Only when |
A stars
object converted from the input object or a provided set of parameters
library(stars)
landform = read_stars(system.file("raster/landforms.tif", package = "motif"))
plot(landform)
landform_lsp = lsp_add_stars(landform, window = 100)
plot(landform_lsp)
lc_cove = lsp_signature(landform, type = "cove", window = 200, normalization = "pdf")
lc_cove_lsp = lsp_add_stars(lc_cove)
plot(lc_cove_lsp)
plot(lc_cove_lsp["na_prop"])
# larger data example
library(stars)
landform = read_stars(system.file("raster/landform.tif", package = "motif"))
plot(landform)
landform_lsp = lsp_add_stars(landform, window = 100)
plot(landform_lsp)
lc_cove = lsp_signature(landform, type = "cove", window = 200, normalization = "pdf")
lc_cove_lsp = lsp_add_stars(lc_cove)
plot(lc_cove_lsp)
plot(lc_cove_lsp["na_prop"])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.