plotAreas: Plot areas

View source: R/plot.R

plotAreasR Documentation

Plot areas

Description

Plot areas for a specific group and, if relevant, track and timeslot. If the base raster is in a geographic coordinate system, plotAreas will attempt to convert the dbbmm results to that same geographic system, so everything falls in place.

Usage

plotAreas(
  areas,
  base.raster,
  group,
  timeslot,
  title = NULL,
  col,
  land.col = "#BABCBF80"
)

Arguments

areas

The areas object used to calculate the space use areas at group level.

base.raster

The raster used in the dbbmm calculations.

group

Character vector indicating the group to be displayed.

timeslot

The timeslot to be displayed. Only relevant for timeslot dbbmms.

title

Plot title.

col

Character vector of colours to be used in the plot (same length as the number of contour levels).

land.col

Colour of the land masses. Defaults to semi-transparent grey.

Value

A plot of the overlapping areas between two groups.

Examples


# Import river shapefile
water <- actel::shapeToRaster(shape = paste0(system.file(package = "RSP"), "/River_latlon.shp"), 
size = 0.0001, buffer = 0.05) 

# Create a transition layer with 8 directions
tl <- actel::transitionLayer(x = water, directions = 8)

# Import example output from actel::explore() 
data(input.example) 

# Run RSP analysis
rsp.data <- runRSP(input = input.example, t.layer = tl, coord.x = "Longitude", coord.y = "Latitude")

# Run dynamic Brownian Bridge Movement Model (dBBMM)
dbbmm.data <- dynBBMM(input = rsp.data, base.raster = water, UTM = 56)

# Get dBBMM areas at group level
areas.group <- getAreas(dbbmm.data, type = "group", breaks = c(0.5, 0.95))

# Plot areas at group level
plotAreas(areas.group, group = "G1", base.raster = water)



YuriNiella/RSP documentation built on Feb. 2, 2024, 5:03 a.m.