prepWrapper: Prepare Data for DABOM

View source: R/prepWrapper.R

prepWrapperR Documentation

Prepare Data for DABOM

Description

Filters the compressed detections for those that occur at or after the 'start_node'. Adds directionality and columns to indicate whether detections at each node should be retained for DABOM. If desired, can create the compressed detections with a PTAGIS file path and a configuration file, before doing the rest.

Usage

prepWrapper(
  compress_obs = NULL,
  cth_file = NULL,
  file_type = c("PTAGIS", "Biologic_csv", "raw"),
  configuration = NULL,
  parent_child = NULL,
  start_node = NULL,
  min_obs_date = NULL,
  max_obs_date = NULL,
  ignore_event_vs_release = FALSE,
  add_tag_detects = FALSE,
  save_file = F,
  file_name = NULL,
  ...
)

Arguments

compress_obs

The result of 'compress()'.

cth_file

is the path to the complete tag history file

file_type

describes the source of the complete tag history file.

If PTAGIS, then cth_file should be a PTAGIS observation file downloaded as a csv from PTAGIS. This must be the output from a Complete Tag History query (part of the Advanced Reporting). This query should contain: Tag, Mark Species, Mark Rear Type, Event Type, Event Site Type, Event Site Code, Event Date Time, Antenna, Antenna Group Configuration, Event Release Site Code, and Event Release Date Time.

If Biologic_csv, that implies the data was downloaded from Biologic software in a .csv format.

If raw, that implies the data was downloaded directly from the reader, in either a .log or .xlsx format. In this case, the largest string containing alphabetic characters in the file name will be assigned as the site code.

configuration

is a data frame which assigns node names to unique site, antenna, and site configuration ID combinations. One example can be built with the function 'buildConfig'. If no configuration file is provided, nodes are considered site codes by default. If nodes are assigned, the column name should be 'node'.

parent_child

data frame with at least 'parent' and 'child' columns. Can be created with 'buildParentChild()' function.

start_node

character of the node where detection histories should begin. If 'NULL', the node order from the parent-child table will be constructed, and the node with node order of 1 will be used.

min_obs_date

Character string in the format "YYYYMMDD". If included, the output will filter out observations prior to this date.

max_obs_date

Character string in the format "YYYYMMDD". If included, the output will suggest that observations after this date should be deleted.

ignore_event_vs_release

Should the function attempt to choose whether to use the event time value or the event release time value for different release batches? Default is 'FALSE'. If set to 'TRUE', the event time value will be used

add_tag_detects

Should a column be added that lists all the sites a tag was detected on, regardless of node? Default is 'FALSE'.

save_file

Should the output be saved to a csv or Excel workbook? Default is 'FALSE'.

file_name

if 'save_file' is 'TRUE', the file name and path to save the output to. Should end in either ".csv" or ".xlsx".

...

other inputs to 'compress', if not using the default values

Value

a tibble

Author(s)

Kevin See

Examples

prepWrapper()

KevinSee/PITcleanr documentation built on Feb. 27, 2024, 11:03 p.m.