ahull_track | R Documentation |
This function approximates the α-convex hull of tracking data and returns a list of geom_path objects of the boundary.
ahull_track(x, y = NULL, alpha, nps = 10000, sc = 100)
x, y |
The |
alpha |
Value of α. |
nps |
Number of points to generate in each segment connecting two locations, see Details |
sc |
Scale factor. |
An attempt is made to interpret the arguments x and y in a way suitable for computing the α-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.
A list of geom_path objects defining the boundary of the α-convex
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.
## Not run: library(move) library(ggmap) # Data from Movebank # Study Name: Dunn Ranch Bison Tracking Project # Principal Investigator: Stephen Blake, Randy Arndt, Doug Ladd # Max Planck Institute for Ornithology Radolfzell Germany study <- "Dunn Ranch Bison Tracking Project" cainfo <- system.file("CurlSSL", "cacert.pem", package = "RCurl") options(RCurlOptions = list(verbose = FALSE, capath = cainfo, ssl.verifypeer = FALSE)) # Login to movebank (first create the login object) curl <- movebankLogin(username = "xxx", password = "zzz") # Downloads study stored in Movebank track <- getMovebankData(study = study, login = curl) dat <- track@data[track@data[, "deployment_id"] == 13848432,] # Map of animal locations bbox <- ggmap::make_bbox(dat[,"location_long"], dat[,"location_lat"], f = 0.3) map_loc <- get_map(location = bbox, source = "google", maptype = 'satellite') map <- ggmap(map_loc, extent = 'panel', maprange=FALSE) p <- map + geom_path(data = dat, aes(x = location_long, y = location_lat), col=2, size=0.3) p ah_gp <- ahull_track(x = dat[, c("location_long", "location_lat")], alpha = 0.005) p + ah_gp ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.