Learn R Programming

mkde (version 0.1)

deselectLocationsOutsideBounds: Flag 3D locations with out-of-bounds z-coordinates

Description

For a 3D MKDE object and 3D location data, the z-coordinates in the location data are checked to make sure they are within the lower and upper bounds specified in the MKDE list object.

Usage

deselectLocationsOutsideBounds(move.dat, mkde.obj)

Arguments

move.dat
A move data object created with initializeMovementData
mkde.obj
An MKDE object created with initialize2DMKDE or initialize3DMKDE

Value

An updated move data list object is returned.

Details

If a 2D or 2.5D MDKE object is passed as an argument, no change is made to the movement data list object. If a 3D MKDE list object is passed as an argument, the z-coordinates in the movement data are checked to determine if they are in range. If they are not, the corresponding value in move.dat$use.obs is set to FALSE. Note that this function is not called within initialzeDensity. If you want to exclude locations because they are outside of the allowed range in the z-dimension, this function must be used before computing the density.

Examples

Run this code
library(raster)
data(condor)
mv.dat <- initializeMovementData(condor$time, condor$x, condor$y, 
z.obs=condor$z, sig2obs=25.0, sig2obs.z=81.0, t.max=65.0)

data(condordem)
cell.sz <- mean(res(condordem))
ext <- extent(condordem)
nx <- ncol(condordem)
ny <- nrow(condordem)
mkde.obj <- initializeMKDE3D(ext@xmin, cell.sz, nx, ext@ymin, cell.sz,
ny, min(values(condordem), na.rm=TRUE), 30.0, 100)
mkde.obj <- setMinimumZfromRaster(mkde.obj, condordem)
mv.dat <- deselectLocationsOutsideBounds(mv.dat, mkde.obj)

Run the code above in your browser using DataLab