compress_raw_data: Clean and Compress Raw Telemetry Data

View source: R/compress_raw_data.R

compress_raw_dataR Documentation

Clean and Compress Raw Telemetry Data

Description

A wrapper function for clean_raw_data(), round_tag_codes(), and compress_txt_data(). Cleans records, rounds tag codes, and then compresses the detections, showing the first and last detection on each receiver for each tag, and how many times it was detected on that receiver in that window. compress_raw_data is similar to the routine Tracker uses to compress .txt format data to .csv format.

Usage

compress_raw_data(
  raw_data = NULL,
  min_yr = 2017,
  max_yr = NA,
  filter_valid = T,
  round_to = 10,
  timer_tag_code = "57",
  noise_tag_code = "99",
  max_min = 2,
  assign_week = T,
  week_base = "0901",
  append_week = c("first", "last")
)

Arguments

raw_data

a data frame containing raw data from telemetry receivers and the Tracker software, typically an output from read_txt_data()

min_yr

the minimum acceptable year (e.g. 2017), likely the year at the start of a season. Used to filter errant dates that occur within the data pre-season.

max_yr

maximum acceptable year (e.g. 2018), likely the year at the end of a season. Used to filter errant dates that occur within the data post-season.

filter_valid

should only valid records in the raw_data be returned? Default is TRUE which only returns records where valid == 1. This uses the 4th column in the raw Tracker software .txt downloads.

round_to

the integer that the user would like to round tag_code to. Currently supports either 5 or 10. If round_to = 5, will round to the nearest 5. If round_to = 10, will round to the nearest 0.

timer_tag_code

the beginning of the tag code associated with timer tags. Default value is "57".

noise_tag_code

the beginning of the tag code associated with noise tags. Default value is "99".

max_min

maximum number of minutes between detections of a tag before it's considered a different "group" of detections. Default is 2.

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 data frame containing a compressed format of the telemetry receiver records

Author(s)

Kevin See and Mike Ackerman


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