This document is intended to provide basic information on how to use the CPFMove functions. This package is designed to work with raw GPS data and especially for species showing a central-place foraging behavior (CPF i.e. tendancy to an animal to leave and return to a fixed based between foraging trips, rather than being in constant roaming). The package has three main objectives:
- Facilitating the delineation of trip from raw GPS data for CPF species
- Offering basic tools for filtering/enhancing the quality of the trips
- Offering basic diagnostic tools for parameter selection
- Offering a basic plotting function to visually assessed the reliability of delineated tracks
The algortihm rely on a local metadata file that contains the information necessary to accurately delineating trips. Nine arguments are necessary for delineating trips (see below). Although this information is mandatory, the algorithm is flexible in regards of column’s names and can be specified accordingly in the main function
head(metafile)
## Colony Clongitude Clatitude Year MetalRing GPSType FIX Deployment Recapture
## 1 OBS 12.28246 78.93942 GPS17 6234054 Catlog 2 2017-07-27 2017-07-29
## 2 OSS 12.44365 78.92961 GPS17 6234065 IGotU 2 2017-07-28 2017-07-30
## 3 OBS 12.28246 78.93942 GPS18 6228840 IGotU 10 2018-06-27 2018-06-30
## 4 OSS 12.44365 78.92961 GPS18 6228779 IGotU 10 2018-06-28 2018-07-01
## 5 OSS 12.44365 78.92961 GPS18 6228876 IGotU 2 2018-07-11 2018-07-17
## 6 OBS 12.28246 78.93942 GPS18 6228776 IGotU 2 2018-07-13 2018-07-15
## UTC_Deployment UTC_Retrieval
## 1 11:29 13:20
## 2 12:36 13:40
## 3 15:10 11:31
## 4 11:23 12:50
## 5 11:05 09:43
## 6 10:51 11:53
Trip delineation is performed via the filt()
function. The function has many arguments which among those, 5 has filtering effect (see ?filt()
for the corresponding details);
The main purpose of this package is to facilitate the delineation of foraging trips from raw GPS data.Trip delineation is however a relatively flexible procedure and rely essentially on how we define “spatially” the colony.
The colony radius is the main parameter for delineation (see BuffColony). In other words, this treshold (km) is used to build an area around the colony’s centroid. From that area, all locations falling inside will be categorized as colony locations and those falling outside as trip ones. This binary category will thereafter be used for segmenting each foraging trip, i.e. having the last point in the colony before departure and the first point at the colony at arrival
The BuffColony argument have an important effect on the resulting trip dataset. This package has one function for investigating such effect.
SensCol()
This is a bootstrap function for estimating the variation within and among customized scenarios. Here, scenarios are a sequence of buffer radii (km). These normally described a decaying function of the number of final trips along increment of the radius size of the colony and the minimal duration that a trip should have. The second rate of change is also computed, among means of the different bootstrapping scenario. User can thus decide of a certain treshold to show where the variation among scenario “stabilize”. In this function (see below) iter correspond to the number of bootsrap iterations
param <- seq(0.05, 1, by = 0.05) ## Radii in kilometers
sc <- sensCol(pathF, pathM, metname, timezone, iter = 300, param = param, speedTresh = 90,
gpst = "GPSType", ddep = "deployment", drecap = "recapture", colony = "colony",
year = "year", ring = "ring", FIX = "FIX", tdep = "utc_deployment", trecap = "utc_retrieval",
FixInt = 2, Interpolate = T)
Below an example of sensitivity of the response over a serie of radius scenario.In that example, the optimal radius has been chosen as 250m. This parameter could therefore be used in the filt()
function in the BuffColony argument. Using the second order rate of change (SORC), this scenario revealed to have an absolute variation of less than 5% of the maximum average value of the scenario tested (i.e. ca. 13.7, corresponding to a SORC of < (13.7*0.05)
Parameters selection is highly dependable of the species under investigation and its relative behavior. The function has in total 5 filtering options, which will impact to a varying extent the final outputs:
?filt()
documentationSensTime()
works the same as the SensCol()
but aims to evaluate the sensitivity of the results as function of different minimum time thresold that a trip should have. See ?SensTime()
for more detailsOne could also based his/her filtering parameterization based on the frequency histograms. In the case of the filtNA argument, one could set filtNA = 1 and run;
f <- filt(pathF, pathM, metname, timezone, speedTresh = 90, gpst = "GPSType",
ddep = "deployment", drecap = "recapture", colony = "colony", year = "year",
ring = "ring", FIX = "FIX", tdep = "utc_deployment", trecap = "utc_retrieval",
BuffColony = 0.25, MinTripDur = 30, Complete = T, FixInt = 2,
Interpolate = T, filtNA = 1, metINFO = c("ring", "year", "species", "colony"), splt = F)
this function will give the following object;
head(f)
## datetime Latitude Longitude trackID nbNA
## 619 2017-07-04 10:29:32 74.34928 19.09229 2017_MRK_6177598_2017-07-06 0
## 620 2017-07-04 10:31:32 74.35087 19.09306 2017_MRK_6177598_2017-07-06 0
## 621 2017-07-04 10:33:32 74.36522 19.05411 2017_MRK_6177598_2017-07-06 1
## 622 2017-07-04 10:35:32 74.38340 19.01465 2017_MRK_6177598_2017-07-06 0
## 623 2017-07-04 10:37:32 74.38385 19.01490 2017_MRK_6177598_2017-07-06 0
## 624 2017-07-04 10:39:32 74.38540 19.02510 2017_MRK_6177598_2017-07-06 0
## ColonyDist PointDist TimeElapsed Speed ColonyorTrip tripID
## 619 0.0000000 0.04604938 120 0.3837448 colony 11
## 620 0.2656363 0.17897889 120 1.4914907 trip 11
## 621 2.2050493 1.98556201 120 16.5463501 trip 11
## 622 4.5551192 2.35066068 120 19.5888390 trip 11
## 623 4.5936811 0.05004899 120 0.4170749 trip 11
## 624 4.5990650 0.35208534 120 2.9340445 trip 11
## birdTrip TripLength TripDist nPoints maxDist
## 619 2017_MRK_6177598_2017-07-06_11 2630 733.2717 1316 284.0867
## 620 2017_MRK_6177598_2017-07-06_11 2630 733.2717 1316 284.0867
## 621 2017_MRK_6177598_2017-07-06_11 2630 733.2717 1316 284.0867
## 622 2017_MRK_6177598_2017-07-06_11 2630 733.2717 1316 284.0867
## 623 2017_MRK_6177598_2017-07-06_11 2630 733.2717 1316 284.0867
## 624 2017_MRK_6177598_2017-07-06_11 2630 733.2717 1316 284.0867
## propNA BegPoint EndPoint ring year species colony ColLong ColLat
## 619 0.1854103 colony colony 6177598 2017 rissa MRK 19.09303 74.34849
## 620 0.1854103 colony colony 6177598 2017 rissa MRK 19.09303 74.34849
## 621 0.1854103 colony colony 6177598 2017 rissa MRK 19.09303 74.34849
## 622 0.1854103 colony colony 6177598 2017 rissa MRK 19.09303 74.34849
## 623 0.1854103 colony colony 6177598 2017 rissa MRK 19.09303 74.34849
## 624 0.1854103 colony colony 6177598 2017 rissa MRK 19.09303 74.34849
make sure to consider only one value per trip (and not all locations);
df <- as.data.frame(f[!duplicated(f$birdTrip),])
and then;
hist(df$propNA, main ="", xlab="Proportion of NAs following interpolation")
whereas the y-axis represent the number of unique trips in the dataset. From that figure, one could thus decide of the appropriate “arbitrarily” treshold to consider (e.g. using filtNA = 0.8 would remove all trips that have a proportion of NAs => 0.8)
Finally, on can also filterate as function of the completeness of the tracks (see Complete). Depending of the question and data representation, one could decide to only use complete trips for his/her analyses Interpolation is executed by adehabitatLT::redisltraj()
. If you want to add additional data to the final objects, these one needs to could be easily attached from the metadata, using the metINFO = c(“ring”, “year”, “colony”)
argument The option splt let you split the final object into an array instead of a data frame. In case the splt is set to TRUE, the object can be unsplitted thereafter using do.call(rbind, object)
The script has now produced one object containing the segmented trips. One way to visualize those trips is to pass them into the plottingMAP()
function;
Using the previous object from the filt()
function, the plottingMAP()
function plots each trip, along with the colony and the trip’s locations (blue = colony; purple = trip locations). The function use the basemap()
from the ggOceanMaps package in its pipeline. If mulitple trips are given, the function will make one figure per trip
A path should first be declared, for instance;
path <- c("C:/Users/Desktop/map")
The following script codes now for plotting only the first bird from the splitted object (see splt object from the filt()
);
plotMAP(f[1], pmap = F, path = path, ColLong = f[1]$ColLong, ColLat = f[1]$ColLat)
Giving the following output;