mkdeToRaster: MKDE to RasterLayer or RasterStack

Description Usage Arguments Details Value Author(s) Examples

View source: R/mkdeFunctions.R

Description

Converts an MKDE into a RasterLayer or RasterStack so that raster package functions can be used.

Usage

1
mkdeToRaster(mkde.obj)	

Arguments

mkde.obj

A 2D, 2.5D, or 3D MKDE object created with initialize2DMKDE or initialize3DMKDE and density initialized with initializeDensity

Details

This method converts the density array in the MKDE oject to an object of a class from the raster package. This allows the functions in the raster package to be used with the MKDEs.

Value

If the MKDE is 2D or 2.5D, a RasterLayer object is returned. If the MKDE is 3D, a RasterStack is returned with one layer in the stack per level.

Author(s)

Jeff A. Tracey, PhD
USGS Western Ecological Research Center, San Diego Field Station
[email protected]
James Sheppard, PhD
San Diego Zoo Institute for Conservation Research
[email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
library(raster)
# set up MKDE object
data(pandadem)
cell.sz <- mean(res(pandadem))
ext <- extent(pandadem)
nx <- ncol(pandadem)
ny <- nrow(pandadem)
mkde.obj <- initializeMKDE2D(ext@xmin, cell.sz, nx, ext@ymin, cell.sz, ny)

# set up movement data
data(panda)
mv.dat <- initializeMovementData(panda$time, panda$x, panda$y, 
sig2obs=25.0, t.max=185.0)

# estimate density
dens.res <- initializeDensity(mkde.obj, mv.dat)
mkde.obj <- dens.res$mkde.obj
mv.dat <- dens.res$move.dat
mkde.rst <- mkdeToRaster(mkde.obj)
plot(mkde.rst)

## End(Not run)

mkde documentation built on May 29, 2017, 8:26 p.m.