new_pit: Collates data from readers in new format (>V5.0)

Description Usage Arguments Details Value Examples

Description

Function collates data located in the working directory that were collected from readers with a firmware version later than 5.0 (April 2014). Users must define the working directory where the PIT files are located. If data is being collated from different formats, the user must specify separate working directories for each format and use the applicable PITR function to collate (see details).

Usage

1
2
new_pit(data, test_tags = NULL, print_to_file = FALSE,
  time_zone = NULL, old_format_data = NULL)

Arguments

data

filepath of the working directory containing data in new format

test_tags

concatenated list of PIT codes used for testing antenna performance

print_to_file

export metadata to working directory

time_zone

time zone where data were collected, default is computer time zone

Details

Users can apply the print_to_file argument to export metadata to the working directory to confirm that data collation was performed correctly. Data files must be named in the following format: pit_reader_mm_dd_yyyy.txt. Note that pit_reader is the unique name of the PIT reader and that mm, dd, and yyyy must be separated by underscores. If .txt is not at the end of each file, the user must enter .txt manually to each file prior to reading in the data. Users can choose to specify the time zone where data were collected in the rare event that this is different from the computer time zone.

Test tags can be removed from the data using the test_tag argument. Users can also include a data frame called study tags in .csv or .txt format (i.e., study_tags.csv or study_tags.txt) in the working directory that contains the full list of tags used in a study in one column called study_tags. Tag codes for study tags and test tags must be complete: 900_230000010075 and not 10075, 0000_0000000183783293 and not 183783293. If the study tag data frame exists, the function will automatically subset the data to retain only the applicable tags. If no data frame of study tags exists in the working directory, it is assumed that no tag codes are subsetted out of the dataset.

There are three versions of ORFID PIT readers that can be collated using PITR: an older format prior to 2014 (use old_pit), a version from 2015 to 2018 (use new_pit), and the most current version from 2019 (use pit_2019). To combine data from multiple reader versions, separate files into working directories based on version, collate using the appropriate PITR function, then use rbind(old_pit$all_det, new_pit$all_det, pit_2019$all_det) to concatenate the detection dataframes prior to further analysis. Note: pit_2019 is a preliminary function and will continue to be updated.

Value

List of data frames consisting of detection records, event records, error records from single and multi readers, and character vectors of unique single and multi readers.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Collate data and print metadata to working directory

# Define working directory
new <- "./New PIT Data/"

# Identify the three test tags used in the study
tt <- c("900_230000010075", "900_230000010079", "900_230000010080")

# Run new_pit function
new_pit(data = new, test_tags = tt, print_to_file = TRUE, time_zone = "America/Vancouver")

InStreamFisheries/PITR documentation built on Jan. 7, 2021, 1:02 p.m.