Learn R Programming

mkde (version 0.4)

setMaximumZfromRaster: Initialize maximum z-axis value from a raster

Description

Set the upper bounds in the z-dimension for each location in the x and y dimensions from a raster.

Usage

setMaximumZfromRaster(mkde.obj, spat.raster)

Value

An updated MKDE list object is returned.

Arguments

mkde.obj

2D or 3D MKDE object created with initialize3DMKDE or initialize3DMKDE, respectively

spat.raster

A RasterLayer object representing the lower bounds of the space the animal may occupy in the z-dimension.

Author

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

Details

This function sets the upper bounds of the space the animal may occupy in the z-dimension. For example, the ascii.raster.filez argument may represent a raster for elevation for subterranean animals, or other surface.

Examples

Run this code
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 <- setMaximumZfromRaster(mkde.obj, dugongdem)

Run the code above in your browser using DataLab