prep_capture_history: Prepare Capture Histories

View source: R/prep_capture_history.R

prep_capture_historyR Documentation

Prepare Capture Histories

Description

Generates a data frame containing all the necessary information for capture histories of tagged fish

Usage

prep_capture_history(
  compress_df = NULL,
  tag_data = NULL,
  n_obs_valid = 3,
  rec_site = NULL,
  delete_upstream = T,
  location = c("site", "receiver"),
  output_format = c("all", "wide", "long"),
  assign_week = T,
  week_base = "0901",
  append_week = c("first", "last")
)

Arguments

compress_df

compressed observational data. Either the output of read_csv_data() or read_txt_data() and compress_raw_data().

tag_data

dataframe with metadata for each tag, including columns named tag_id, tag_purpose (with some tags having "fish" in this column), release_site (which is one of the sites in the rec_site input) and release_time.

n_obs_valid

minumum number of observations made at a location to be considered valid.

rec_site

data.frame with 2 columns, site and receiver, with sites and and receivers as factors with levels in order.

delete_upstream

should detections that indicate upstream movement be deleted?

location

should detections be grouped by site or receiver?

output_format

return either wide or long format, or both plus tag metadata

assign_week

Should this function assign a week number to the output? Default is TRUE

week_base

If assigning week numbers, the date when the numbering should start in "MMDD" format

append_week

If assigning weeks, should the week be assigned based on the first or last time a tag was detected on that receiver? Default value is first.

Value

a list containing a capture history in wide format, one in long format, and metadata for each tag

Author(s)

Kevin See and Mike Ackerman


mackerman44/telemetyr documentation built on Feb. 15, 2025, 1:08 a.m.