View source: R/mkdeFunctions.R
setMinimumZfromRaster | R Documentation |
Set the lower bounds in the z-dimension for each location in the x and y dimensions from a raster.
setMinimumZfromRaster(mkde.obj, spat.raster)
mkde.obj |
A 2D or 3D MKDE object created with
|
spat.raster |
A RasterLayer object representing the lower bounds of the space the animal may occupy in the z-dimension. |
This function sets the lower bounds of the space the animal may occupy
in the z-dimension. For example, the ascii.raster.file
argument
may represent a raster for elevation, depth of the sea floor, or other
surface.
An updated MKDE list object is returned.
Jeff A. Tracey, PhD
USGS Western Ecological Research Center, San Diego Field Station
jatracey@usgs.gov
James Sheppard, PhD
San Diego Zoo Institute for Conservation Research
jsheppard@sandiegozoo.org
library(terra)
fpath <- system.file("extdata", "dugongdem.RDS", package="mkde")
dugongdem <- terra::readRDS(fpath)
cell.sz <- mean(res(dugongdem))
ext <- ext(dugongdem)
nx <- ncol(dugongdem)
ny <- nrow(dugongdem)
mkde.obj <- initializeMKDE3D(ext$xmin, cell.sz, nx, ext$ymin, cell.sz,
ny, min(values(dugongdem), na.rm=TRUE), 50.0, 15)
mkde.obj <- setMinimumZfromRaster(mkde.obj, dugongdem-20.0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.