actel (version 1.1.0)

migration: Migration Analysis

Description

The migration analysis runs the same initial checks as explore, but on top of it, it analyses the fish behaviour. By selecting the arrays that lead to success, you can define whether or not your fish survived the migration. Additional plots help you find out if some fish has been acting odd. Multiple options allow you to tweak the analysis to fit your study perfectly.

Usage

migration(
  tz = NULL,
  sections,
  section.order = NULL,
  datapack = NULL,
  success.arrays = NULL,
  max.interval = 60,
  minimum.detections = 2,
  start.time = NULL,
  stop.time = NULL,
  speed.method = c("last to first", "last to last"),
  speed.warning = NULL,
  speed.error = NULL,
  jump.warning = 2,
  jump.error = 3,
  inactive.warning = NULL,
  inactive.error = NULL,
  exclude.tags = NULL,
  override = NULL,
  report = FALSE,
  auto.open = TRUE,
  discard.orphans = FALSE,
  discard.first = NULL,
  save.detections = FALSE,
  if.last.skip.section = TRUE,
  replicates = NULL,
  disregard.parallels = TRUE,
  GUI = c("needed", "always", "never"),
  print.releases = TRUE,
  plot.detections.by = c("stations", "arrays")
)

Arguments

tz

The time zone of the study area. Must match one of the values present in timezones.

sections

DEPRECATED - list the sections in the spatial input instead.

section.order

A vector containing the order by which sections should be aligned in the results.

datapack

A data bundle pre-compiled through the function preload. May be used to run actel analyses based on R objects, rather than input files.

success.arrays

The arrays that mark the end of the study area. If a fish crosses one of these arrays, it is considered to have successfully migrated through the study area.

max.interval

The number of minutes that must pass between detections for a new event to be created. Defaults to 60.

minimum.detections

For tags with only one movement event, defines the minimum number of times a tag must have been recorded during the study period for it to be considered true detections and not random noise. Defaults to 2.

start.time

Detection data prior to the timestamp set in start.time (in YYYY-MM-DD HH:MM:SS format) is not considered during the analysis.

stop.time

Detection data posterior to the timestamp set in stop.time (in YYYY-MM-DD HH:MM:SS format) is not considered during the analysis.

speed.method

Can take two forms: 'last to first' or 'last to last'. If 'last to first' (default), the last detection on the previous array is matched to the first detection on the target array to perform the calculations. If 'last to last', the last detection on <U+00B4>the previous array is matched to the last detection on the target array to perform the calculations.

speed.warning

If a fish moves at a speed equal or greater than speed.warning (in metres per second), a warning is issued. If left NULL (default), no warnings are issued.

speed.error

If a fish moves at a speed equal or greater than speed.error (in metres per second), user intervention is suggested. If left NULL (default), user intervention is never suggested.

jump.warning

If a fish crosses a number of arrays equal or greater than jump.error without being detected, a warning is issued. If left NULL (default), no warnings are issued.

jump.error

If a fish crosses a number of arrays equal or greater than jump.error without being detected, user intervention is suggested. If left NULL (default), user intervention is never suggested.

inactive.warning

If a fish spends a number of days equal or greater than inactive.error in a given array at the tail of the respective detections, a warning is issued. If left NULL (default), no warnings are issued.

inactive.error

If a fish spends a number of days equal or greater than inactive.error in a given array at the tail of the respective detections, user intervention is suggested. If left NULL (default), user intervention is never suggested.

exclude.tags

A vector of tags that should be excluded from the detection data before any analyses are performed. Intended to be used if stray tags from a different code space but with the same signal as a target tag are detected in the study area.

override

A vector of signals for which the user intends to manually define which movement events are valid and invalid.

report

Logical. Should an HTML report be created at the end of the analysis? NOTE: Setting report to TRUE will generate an HTML file in the current directory. Additionally, if auto.open = TRUE (default), the web browser will automatically be launched to open the report once the function terminates.

auto.open

Logical: Should the report be automatically opened once the analysis is over? Defaults to TRUE. NOTE: If report = TRUE and auto.open = TRUE, the web browser will automatically be launched to open the report once the function terminates.

discard.orphans

Logical: Should actel automatically discard detections that do not fall within receiver deployment periods, or that were recorded before the respective fish were released?

discard.first

A threshold amount of time (in hours) that must pass after release for the respective detections to be valid. Set to 0 to discard only the release-to-first-detection calculations.

save.detections

Logical: Should the processed detections be saved for future runs?

if.last.skip.section

Logical: Should a fish detected at the last array of a given section be considered to have disappeared in the next section?

replicates

A list containing, for each array to which intra-array efficiency is to be calculated: The standard names of the stations to be used as a replicate. See the vignettes for more details.

disregard.parallels

Logical: Should the presence of parallel arrays invalidate potential efficiency peers? See the vignettes for more details.

GUI

One of "needed", "always" or "never". If "needed", a new window is opened to inspect the movements only when the movements table is too big to be displayed in R's console. If "always", a graphical interface is always created when the possibility to invalidate events emerges. If "never", a graphical interface is never invoked. In this case, if the table to be displayed does not fit in R's console, a temporary file will be saved and the user will be prompted to open that file and examine it. Defaults to "needed".

print.releases

Logical: Should the release sites be printed in the study area diagrams?

plot.detections.by

The type of y axis desired for the individual detection plots. One of "stations" (default) or "arrays".

Value

A list containing:

  • detections: A list containing all detections for each target fish;

  • valid.detections: A list containing the valid detections for each target fish;

  • spatial: A list containing the spatial information used during the analysis;

  • deployments: A data frame containing the deployments of each receiver;

  • arrays: A list containing the array details used during the analysis;

  • movements: A list containing all movement events for each target fish;

  • valid.movements: A list containing the valid movement events for each target fish;

  • section.movements: A list containing the valid section shifts for each target fish;

  • status.df: A data.frame containing summary information for each fish, including the following columns:

    • Times.entered.[section]: Number of times the fish was recorded entering a given section.

    • Average.time.until.[section]: Time spent between release or leaving another section and reaching at the given section.

    • Average.speed.to.[section]: Average speed from release or leaving one section and reaching the given section (if speed.method = "last to first"), or from release/leaving one section and leaving the given section (if speed.method = "last to last").

    • First.array.[section]: Array in which the fish was first detected in a given section

    • First.station.[section]: Standard name of the first station where the fish was detected in a given section

    • First.arrived.[section]: Very first arrival time at a given section

    • Average.time.in.[section]: Average time spent within a given section at each stay.

    • Average.speed.in.[section]: Average speed within a given section at each stay (only displayed if speed.method = "last to first").

    • Last.array.[section]: Array in which the fish was last detected in a given section

    • Last.station.[section]: Standard name of the last station where the fish was detected in a given section

    • Last.left.[section]: Very last departure time from a given section

    • Total.time.in[section]: Total time spent in a given section

    • Very.last.array: Last array where the fish was detected

    • Status: Fate assigned to the fish

    • Valid.detections: Number of valid detections

    • Invalid.detections: Number of invalid detections

    • Backwards.movements: Number of backward movement events

    • Max.cons.back.moves: Longest successive backwards movements

    • P.type: Type of processing:

      • 'Skipped' if no data was found for the fish,

      • 'Auto' if no user interaction was required,

      • 'Manual' if user interaction was suggested and the user made changes to the validity of the events,

      • 'Overridden' if the user listed the fish in the override argument.

    • Comments: Comments left by the user during the analysis

  • section.overview: A data frame containing the number of fish that disappeared in each section;

  • group.overview: A list containing the number of known and estimated fish to have passed through each array, divided by group;

  • release.overview: A list containing the number of known and estimated fish to have passed through each array, divided by group and release sites;

  • matrices: A list of CJS matrices used for the efficiency calculations;

  • overall.CJS: A list of CJS results of the inter-array CJS calculations;

  • intra.array.CJS: A list of CJS results of the intra-array CJS calculations;

  • times: A data frame containing all arrival times (per fish) at each array;

  • rsp.info: A list containing appendix information for the RSP package;

  • dist.mat: The distance matrix used in the analysis (if a valid distance matrix was supplied)

See Also

explore, residency

Examples

Run this code
# NOT RUN {
# Start by moving to a temporary directory
old.wd <- getwd()
setwd(tempdir())

# Deploy the example workspace
exampleWorkspace("exampleWorkspace")

# Move your R session into the example workspace
setwd("exampleWorkspace")

# run the migration analysis. Ensure the tz argument
# matches the time zone of the study area and that the
# sections match your array names. The line below works
# for the example data.
results <- migration(tz = "Europe/Copenhagen")

# to obtain an HTML report, run the analysis with report = TRUE

# return to original working directory
setwd(old.wd)
rm(old.wd)
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace