processMovedata: process Move data

Description Usage Arguments Details Value See Also Examples

View source: R/processMovedata.R

Description

Transforms a movebank object into an (optionally) daily averaged simplified data frame that is a "movetrack" class object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
processMovedata(
  movedata,
  xyNames = c("location_long", "location_lat"),
  idcolumn = "individual_id",
  proj4 = NULL,
  projTo = NULL,
  utm = FALSE,
  keepCols = NULL,
  dailymean = FALSE
)

Arguments

movedata

movement data - can be a Move object (or stack) from movebank

idcolumn

name of the id column - depends on properties of the movebank data. The default "individual_id" is often good. Other options are "deployment_id" or maybe "individual_id" ... this is confusing!

proj4

the projection (as a crs string) for input data. If it is left empty and movedata is a Move object, it will carry over the projection from the original data. If movedata is a data frame, it will use the "WGS84" projection, using the midpoint of the longitudes and latitudes in the data, i.e. (min(long,lat) + max(long,lat))/2.

projTo

a crs string for (re)projecting input data (if utm is FALSE).

utm

whether to convert to UTM coordinates - using the central longitude to select the zone. This is best for data of relatively small extent.

keepCols

scd: to see available info to retain see the reference data for the study using getMovebank("tag"), getMovebank("individual"), getMovebank("deployment"), or IMO better to get all of it as a single table excluding unused attributes by downloading from Movebank (Download > Download Reference Data).

dailymean

whether or not to compute the daily mean - useful for the migration analysis.

Details

Regarding the idcolumn issues, SCD has the following insights (2017-06):

Even more than confusing, this is a possible cause of error. There is a current bug in move whereby when data are accessed using getMovebankData, the tracks will be separated by deployment rather than individual. In cases that an individual has been tracked over multiple deployments, each deployment will be incorrectly understood to be and analyzed as a separate animal. See https://gitlab.com/bartk/move/issues/2

deployment_id is in general not an appropriate idcolumn to use, for the same reason described above. Many of our studies include individuals with multiple deployments.

idcolumn should ideally show animalName or individual_local_identifier, i.e. the "animal id" in Movebank. sometimes move uses the internal database ids, e.g. individual_id which is difficult to link back to the animal in Movebank.

Currently in some cases coords.x1 and coords.x2 are used instead of location.long, location.lat. See https://gitlab.com/bartk/move/issues/5 and https://gitlab.com/bartk/move/issues/3

Value

Returns a data frame with columns:

TO DO - add tags: If getVT = TRUE, also returns:

If dailymean = TRUE,

If returnOutliers = TRUE and returnSPDF = FALSE, a list of two elements containing the valid locations ($valid or list[[1]]) or outliers ($flaggedOutliers or list[[2]]). scd: For "time", note possible issues with timezones changing when moveStacks are created: https://gitlab.com/bartk/move/issues/6

See Also

map.track, plot.track, SpatialPointsDataFrame, pointDistance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
### Enter Login and Password information for Movebank

## Not run: 
# login <- movebankLogin(username="xxxx", password="xxxx")

# Pull data from movebank
ge1 <- getMovebankData(study="ABoVE: HawkWatch International Golden Eagles", login=login)     #multiple birds

# Estimate daily mean locations
ge1.dailymean <- processMovedata(ge1,  id = "individual_id", dailymean = TRUE)

# Three convenient "movetrack" methods:
summary(ge1.dailymean)
plot(ge1.dailymean)
map(ge1.dailymean)


# one bird, three deployments
ge2 <- getMovebankData(study="Aquila chrysaetos interior west N. America, Craigs, Fuller", animalName="629-26704", login=login) 

# all locations and all columns
ge2.dailymean <- processMovedata(ge2,  id = "individual_id", keepCols = "all")
summary(ge2.dailymean)
plot(ge2.dailymean, id = ge2.dailymean$id[1])
map(ge2.dailymean)

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