Learn R Programming

move (version 3.2.2)

raster2contour: Convert raster to contour lines

Description

The function converts a raster UD(stack) object to a SpatialLinesDataFrame. This allows to re-project the contours to different projections.

Usage

# S4 method for .UD
raster2contour(x, ...)
	# S4 method for .UDStack
raster2contour(x, ...)

Arguments

x

a DBBMM, DBBMMStack, dynBGB, .UD or .UDStack object

...

additional arguments, like levels and nlevels, that can be passed to 'rasterToContour' function

Value

'SpatialLinesDataFrame'

Details

The contour function creates a shape of the area in which the animal can be found by a certain probability (i.e. the 90% contour describes the area in which the animal can be found with the 90% probability). One or several probabilities can be set with levels (numeric or vector of values between 0 and 1). If no value is set all contour lines are returned. You can also use nlevel to set a number of fixed distance levels.

The raster2contour function creates a SpatialLinesDataFrame from the input raster object. This allows to re-project the contours to different projections.

See Also

getVolumeUD, contour, outerProbability

Examples

Run this code
# NOT RUN {
data(leroydbbmm)
data(leroydbgb)
data(dbbmmstack)

## from a DBBMM object
(cont1 <- raster2contour(leroydbbmm))
plot(cont1)

## from a dynBGB object
(cont2 <- raster2contour(leroydbgb, level=.95))
plot(cont2)

## from a DBBMMStack object
(cont3 <- raster2contour(dbbmmstack))
plot(cont3)
(cont4 <- raster2contour(dbbmmstack, level=c(.5,.95)))
plot(cont4)

# }

Run the code above in your browser using DataLab