View source: R/calculate_distance.R
calculate_distance | R Documentation |
Per pixel distance to nearest access vector. Intended to be used as a 'cost' constraint
within the sample_clhs
function
calculate_distance(
raster,
access,
slope = FALSE,
plot = FALSE,
filename = NULL,
overwrite = FALSE
)
raster |
spatRaster. Raster to be used to calculate pixel level distance to access layer. |
access |
sf 'LINESTRING' or 'MULTILINESTRING'. Access network. |
slope |
Logical. Calculate slope distance instead of geographic distance. |
plot |
Logical. Plots output strata raster with samples. |
filename |
Character. Path to write output samples. |
overwrite |
Logical. Choice to overwrite existing |
Input raster with dist2access
layer appended.
Tristan R.H. Goodbody
Other calculate functions:
calculate_allocation()
,
calculate_allocation_existing()
,
calculate_coobs()
,
calculate_pcomp()
,
calculate_pop()
,
calculate_representation()
,
calculate_sampsize()
## Not run:
#--- Load raster and access files ---#
r <- system.file("extdata", "mraster_small.tif", package = "sgsR")
mr <- terra::rast(r)
a <- system.file("extdata", "access.shp", package = "sgsR")
ac <- sf::st_read(a)
calculate_distance(
raster = mr,
access = ac,
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.