landscape_matrix: Create a matrix for the landscape surrounding each site

View source: R/landscape_matrix.R

landscape_matrixR Documentation

Create a matrix for the landscape surrounding each site

Description

landscape_matrix creates the matrix that is used by dist_weight to weight the landscape variable and fit the model.

Usage

landscape_matrix(raster, sites, max.radius, is.factor = FALSE)

Arguments

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).

Details

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.

Value

A matrix used by dist_weight to do the weighting and fit the model.


benjaminiuliano/scalescape documentation built on April 4, 2022, 1:51 p.m.