View source: R/landscape_matrix.R
landscape_matrix | R Documentation |
landscape_matrix
creates the matrix that is used by dist_weight
to weight the landscape variable and fit the model.
landscape_matrix(raster, sites, max.radius, is.factor = FALSE)
raster |
A raster object associated with the landscape variable of interest. |
sites |
An inventory of sites formatted as a 2-column, X-Y data frame, sf object, or sp object. |
max.radius |
The maximum radius you wish to evaluate. Must be less than the maximum extent of the raster. |
is.factor |
Specify whether landscape variable is continuous or binary (FALSE, default) or a factor with more than two levels (TRUE). |
Each row of the landscape_matrix
output corresponds to a raster pixel at a given
location around a site, and each column corresponds to a site. The column
'dist' gives the distance of each pixel to the focal site. For binary
classifications, cell values in the matrix represent whether that pixel is
filled by a land cover type of interest (1 if yes, 0 if no), and for continuous
classifications they correspond to the value of the landscape variable of
interest. When applying landscape_matrix
to a raster, you will need to specify:
The raster associated with the landscape variable you are interested in.
A list of sites formatted as a 2-column X-Y data frame, sf
object,
or sp
object.
The maximum radius you wish to evaluate.This radius should be larger than
what you believe to be the maximum relevant spatial scale for your response variable
(although the larger it is, the longer the computation time). All raster cells up to
this distance will be included in the parameter optimization process used to define
the range parameter. The value for max.radius
must fall within the bounds of
the raster. If max.radius
around at least one site falls outside the bounds of
your raster, you will receive an error message indicating this problem and should
select a raster with a greater extent or choose a smaller max.radius
.
A matrix used by dist_weight
to do the weighting and fit the model.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.