above
R packagerequire(knitr) knit("README.rmd")
knitr::opts_chunk$set(echo = TRUE, cache=TRUE)
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:
summary
, plot
, map.track
) to work with movetrack's Example below:
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)
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)
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()
Examples to come
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.