getCentroids: Get centroid locations of dBBMM

View source: R/get.R

getCentroidsR Documentation

Get centroid locations of dBBMM

Description

When a timeslot dBBMM analysis is conducted, this function can be used to obtain centroid latitude and longitude locations between all utilization distribution contours at group or track level.

Usage

getCentroids(input, areas, type, level, group, UTM)

Arguments

input

The output of dynBBMM.

areas

The output of getAreas.

type

Character vector specifying the type of getAreas analysis performed: "group" or "track".

level

Numeric vector defining the contour level of dBBMM of interest to extract the centroid positions.

group

Character vector defining the group of interest for the analysis, when getAreas is of type "group".

UTM

Numeric vector representing the UTM zone of the study area.

Value

A dataframe containing the centroid positions per each timeslot

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) with timeslots:
dbbmm.data <- dynBBMM(input = rsp.data, base.raster = water, UTM = 56, timeframe = 2)

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

# Obtaing centroid coordinate locations of dBBMM:
df.centroid <- getCentroids(input = dbbmm.data, areas = areas.group, type = "group",
   level = 0.95, group = "G1", UTM = 56)



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