The above R package

authors: Elie Gurarie and collaborators

require(knitr)
knit("README.rmd")

To-Do:

knitr::opts_chunk$set(echo = TRUE, cache=TRUE)

Background

This R package will collaboratively help participants of the Animals on the Move subproject of the Arctic Boreal Vulnerability Experiment (above) share code for analysis of animal movements and migrations.

For now, it contains:

  1. preprocesseing movebank.org functions to get daily means
  2. some convenient methods (summary, plot, map.track) to work with movetrack's
  3. functions for multi-migration analysis

Example below:

Install package

From GitHub, you need to install first the marcher package, then this package:

require(devtools)
install_github("EliGurarie/marcher")
install_github("ABoVE-AotM/above")
require(above)

Loading eagle data

ABoVE members with access to some golden eagle data can load it using

login <- movebankLogin(username = "somethingsecret", password = "somethingsecret")
load(file ="./hidden/movebanklogin.rda")

Load a few datasets:

ge1 <- getMovebankData(study="ABoVE: HawkWatch International Golden Eagles", animalName="37307a", login=login) 
ge2 <- getMovebankData(study="Aquila chrysaetos interior west N. America, Craigs, Fuller", animalName="629-26704", login=login) 
load("./hidden/eagles.rda")

These are Move objects, but they're slightly different:

is(ge1)
is(ge2)

Processing data

For migration analysis we simplify (and get daily averages) using the processMovedata function, which reduces the data to daily average locations (in latitude, longited and x and y):

ge1.simple <- processMovedata(ge1, idcolumn = "deployment_id")
head(ge1.simple)

This is a track object (specific for this package), which has some convenient methods:

summary(ge1.simple)

Note that x and y are UTM coordinates - you can either provide a proj4 projection string or, by default, it will pick the zone of the midpoint.

The plotting function is similar to the scan.track function in marcher

plot(ge1.simple)
png("./plots/ge1.png")
plot(ge1.simple)
dev.off()

For the second data set (ge2) there are three deployments of 1 eagle, each with a unique identifier.

ge2.simple <- processMovedata(ge2, idcolumn = "deployment_id")
summary(ge2.simple)

And we see a simple straight one-time migration in these data.

plot(subset(ge2.simple, id == "196430584"))
png("./plots/ge2.png")
plot(subset(ge2.simple, id == "196430584"))
dev.off()

Migration analysis

Examples to come



ABoVE-AotM/above documentation built on May 28, 2020, 6:08 a.m.