formatDeployments: Format deployment data

View source: R/Process_GPS.R

formatDeploymentsR Documentation

Format deployment data

Description

This function standardizes deployment data, which is the first step in processing any tracking data. The function will create standard field names and formats for key data about each deployment. All deployment times will be converted to UTC, to ensure tracking data are clipped to the correct time.

Usage

formatDeployments(
  deployments,
  dateFormat = "%Y-%m-%d %H:%M",
  dep_tz,
  species,
  metal_band,
  colour_band,
  dep_id,
  fill_dep_id = F,
  site,
  subsite = NA,
  nest = NA,
  dep_lon,
  dep_lat,
  time_released,
  time_recaptured = NA,
  status_on = NA,
  status_off = NA,
  mass_on = NA,
  mass_off = NA,
  exclude = NA,
  fed_unfed = NA,
  gps_id = NA,
  tdr_id = NA,
  acc_id = NA,
  gls_id = NA,
  mag_id = NA,
  cam_id = NA,
  hrl_id = NA,
  keep = NULL
)

Arguments

deployments

A data frame with deployment data. Required.

dateFormat

Character string specifying the POSIX standard format for your deployment times, defaults is Y-m-d H:M:S. See ?strftime for other datetime formats

dep_tz

Timezone of deployment.

species

Character string with name of the field containing the 4-letter AOU species code. Required.

metal_band

Character string with name of the field containing the metal band number. Values should be numeric with 9-10 digits, dashes are not allowed.

colour_band

Character string with name of the field containing the colour band code.

dep_id

Character string with name of the field containing deployment ID (see details). Each dep_id must be unique. Required.

fill_dep_id

Should missing dep_id values be filled by combining metal_band and release date, default is TRUE.

site

Character string with name of the field containing the site (e.g. Coats). Required.

subsite

Character string with name of the field containing the subsite (e.g. Coats West). This is used if your study area has distinct units within the main site.

nest

Character string with name of the field containing the nest id. Optional.

dep_lon

Character string with name of the field containing the deployment longitude. Required.

dep_lat

Character string with name of the field containing the the deployment latitude. Required.

time_released

Character string with name of the field containing deployment start time (when birds was released with tag), must use date format specified with dateFormat argument. Required.

time_recaptured

Character string with name of the field containing deployment end time (when birds was recaptured with tag), must use date format specified with dateFormat argument.

status_on

Breeding status at start of deployment. Values accepted: E - eggs, C - chicks, FB - failed-breeder, NB - non-breeder, PB - pre-breeder, J - juvenile.

status_off

Breeding status at end of deployment. Values accepted: E - eggs, C - chicks, FB - failed-breeder, NB - non-breeder, PB - pre-breeder, J - juvenile.

mass_on

Character string with name of the field containing the bird mass (g) at start of deployment.

mass_off

Character string with name of the field containing the bird mass (g) at end of deployment.

exclude

Character string with name of the field containing flags for deployments with a significant treatment, which could make the data unsuitable for other analysis (e.g. Fed, Handicapped, Wing-clipped).

fed_unfed

Character string with name of the field containing information about fed/unfed treatments. Used for BLKI from Middleton. Acceptable values are: fed, unfed, semi.

gps_id

Character string with name of the field containing the name of the GPS tag deployed.

tdr_id

Character string with name of the field containing the name of the TDR tag deployed.

acc_id

Character string with name of the field containing the name of the ACC tag deployed.

gls_id

Character string with name of the field containing the name of the GLS tag deployed.

mag_id

Character string with name of the field containing the name of the magnetometer tag deployed.

cam_id

Character string with name of the field containing the name of the camera tag deployed.

hrl_id

Character string with name of the field containing the name of the hear rate logger tag deployed.

keep

List of variable names for other dpeloyment data to keep with output.

Details

dep_id is a critical field for matching deployment information to the tracking data. Every dep_id in your data must be unique. If these data will be imported into the Arctic Ecology Lab Biologging database, then each dep_id must be unique within the database. Using a dep_id based on the band number and deployment date will ensure that each dep_id is unique. If your tracking data has a single data file for each deployment (Technosmart, Cattrack, and Lotek units), then the dep_id should be consistent with the name of this file. If the dep_id is not contained within the file name, then the readGPSdata() or readTDRdata() function you use in the next step will not be able to find the data associated with this deployment. If you have remotely downloaded data, where all the locations from all units are mixed together (Ecotone units), then you can leave this field empty use the fill_dep_id = T argument to automatically generate unique dep_ids.

dep_tz and tagTZ are used to make sure a consistent time zone is used clip the GPS data. The output times from this function will be in the tagTZ. Most devices record time in 'UTC'. You can look up timezone codes here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. Eastern time is 'US/Eastern' and Pacific time is 'US/Pacific'.

fed_unfed is specific to data from black-legged kittiwakes (BLKI) at Middleton. This field is used to indicate if the bird in the deployment was part of the fed, unfed, or semi-fed groups. Input values must be either fed, unfed, or semi, captilization does not matter. Other users can ignore this field.

gps_id, tdr_id, acc_id, gls_id, mag_id, cam_id, hrl_id are each used to store the identifier for the biologger units deployed. Because some deployments use multiple devices, and some devices have multiple logger types, each is recorded separately. For example, Technosmart Axy-trek units record GPS, TDR, and ACC data, so the logger id should be entered in each of these fields to show that all thre data types are available. If both an Ecotone GPS and a Lotek TDR were deployed at the same time on the same bird, then record the Ecotone logger ID in the gps_id field and the Lotek TDR logger id in the TDR field.

Value

A new dataframe with deployment times in UTC and field names that are compatible with other functions in this package and the lab biologging database.


allisonglider/seabiRds documentation built on Feb. 14, 2025, 7:37 a.m.