ahull_track: alpha-convex hull calculation of tracking data

ahull_trackR Documentation

alpha-convex hull calculation of tracking data

Description

This function approximates the \alpha-convex hull of tracking data and returns a list of geom_path objects of the boundary.

Usage

ahull_track(x, y = NULL, alpha, nps = 10000, sc = 100)

Arguments

x, y

The x and y arguments provide the x and y coordinates of a set of points. Alternatively, a single argument x can be provided, see Details.

alpha

Value of \alpha.

nps

Number of points to generate in each segment connecting two locations, see Details

sc

Scale factor.

Details

An attempt is made to interpret the arguments x and y in a way suitable for computing the \alpha-convex hull. Any reasonable way of defining the coordinates is acceptable, see xy.coords.

Increase nps if the trajectory is not contained in the computed estimator.

Value

A list of geom_path objects defining the boundary of the \alpha-convex

References

Cholaquidis, A., Fraiman, R., Lugosi, G. and Pateiro-Lopez, B. (2014) Set estimation from reflected Brownian motion. arXiv:1411.0433.

Wikelski, M., and Kays, R. (2014). Movebank: archive, analysis and sharing of animal movement data. World Wide Web electronic publication.

Examples

## Not run: 
# Data from Movebank
# Study Name: Missouri Bison Tracking Project
# Principal Investigator: Stephen Blake
library(move)
# Login to Movebank (requires a Movebank account)
curl <- movebankLogin(username = "xxx", password = "zzz")
# Download study data (requires agreed to the license terms in the web interface)
study <- "Missouri Bison Tracking Project"
animalName <-"AHP2059"
track <- getMovebankData(study = study, animalName = animalName, login = curl)
dat <- track@data
# Plot animal locations
p <- ggplot2::ggplot(
  dat,
  ggplot2::aes(x = location_long, y = location_lat)
) +
  ggplot2::geom_path(
    colour = "red",
    linewidth = 0.3
  ) +
  ggplot2::coord_quickmap()
p
# Alpha-convex hull of the animal trajectory
ah_out <- ahull_track(x = dat[, c("location_long", "location_lat")], alpha = 0.005)
# Plot the trajectory and the alpha-convex hull
p + ah_out

## End(Not run)

alphahull documentation built on Oct. 30, 2026, 1:07 a.m.