Description Usage Arguments Value Author(s) See Also Examples
Calculates and (optionally) plots density contours from a utilization distribution.
1 |
x |
An object of class bbmm, which is a list with vectors |
levels |
A numeric vector of desired contour levels (e.g., |
locations |
(optional) data frame or matrix of |
plot |
Logical. If |
An list with four components.
Components of the returned object are as follows:
contour |
Requested contour level(s). |
z |
values that separate the specified contour level(s). |
Ryan Nielson, Hall Sawyer, and Trent McDonald (WEST, Inc., www.west-inc.com)
Maintainer: Ryan Nielson rnielson@west-inc.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(locations)
BBMM <- brownian.bridge(x=locations$x, y=locations$y,
time.lag=locations$time.lag[-1], location.error=20,
cell.size=50)
contours <- bbmm.contour(BBMM, levels=c(95, 99), locations=locations, plot=TRUE)
# Create a shapefile with contour lines
# Not run: library(maptools)
# Not run: library(raster)
# Not run: out <- data.frame(x=BBMM$x,y=BBMM$y,z=BBMM$probability)
# Make sure the data is properly projected
# Not run: out.raster <- rasterFromXYZ(out,crs=CRS("+proj=utm +zone=12 +datum=WGS84"),digits=2)
# Not run: raster.contour <- rasterToContour(out.raster,levels=contours$Z)
# Not run: raster.contour <- spChFIDs(raster.contour,paste(c(95, 99),"% Contour Line",sep=""))
# Not run: library(rgdal) # can't be loaded before CRS call in line above
# Not run: writeOGR(obj=raster.contour,dsn=".",layer="BBMM",driver="ESRI Shapefile")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.