Title: | Manage and Summarize Data from Oregon RFID ORMR and ORSR Antenna Readers |
---|---|
Description: | Automates and standardizes the import of raw data from Oregon RFID (radio-frequency identification) ORMR (Oregon RFID Multi-Reader) and ORSR (Oregon RFID Single Reader) antenna readers. Compiled data can then be combined within multi-reader arrays for further analysis, including summarizing tag and reader detections, determining tag direction, and calculating antenna efficiency. |
Authors: | Hugo Marques [aut] , Annika Putt [aut, cre] |
Maintainer: | Annika Putt <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.2.9000 |
Built: | 2024-11-21 04:05:48 UTC |
Source: | https://github.com/hugo-marques/orfid |
Determines detection efficiency for each antenna in systems where multiple antennas are used along a linear migration route.
ant_efficiency(x, LOC_vec)
ant_efficiency(x, LOC_vec)
x |
data frame generated using |
LOC_vec |
vector of antenna locations from first encountered to last encountered. |
ant_efficiency
determines the detection efficiency of each antenna in a linear migration route. Direction is determined based on the order of locations from first encountered to last encountered, as specified in LOC_vec. Use site_summary
to identify all locations present in the multi reader data, which must be included in LOC_vec.
Antenna efficiency is determined by identifying which tags were detected at antenna x and which tags were detected anywhere after/above antenna x. The efficiency of antenna x is then the number of shared tag detections divided by the total number of detections after x. Note that efficiency and shared detections cannot be determined for the final antenna as there are no subsequent detections. Reversing the order of LOC_vec can inform efficiency in systems with movement in multiple directions.
Returns a tibble object.
Annika Putt <[email protected]>
import_ORFID
for importing data files from Oregon RFID ORMR and ORSR antenna readers.
join_multireader_data
for combining data from Oregon RFID ORMR and ORSR antenna readers into a multi-reader array.
site_summary
for identifying all locations present in a multi-reader array.
# Create a list containing compiled reader data: readers <- list(reader_us, reader_ds) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers) # List readers: unique(PIT_data$LOC) # Determine antenna efficiency for animals moving from downstream to upstream: ant_efficiency(PIT_data, c("downstream_A1", "upstream_A1")) # Determine antenna efficiency for animals moving from upstream to downstream: ant_efficiency(PIT_data, c("upstream_A1", "downstream_A1"))
# Create a list containing compiled reader data: readers <- list(reader_us, reader_ds) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers) # List readers: unique(PIT_data$LOC) # Determine antenna efficiency for animals moving from downstream to upstream: ant_efficiency(PIT_data, c("downstream_A1", "upstream_A1")) # Determine antenna efficiency for animals moving from upstream to downstream: ant_efficiency(PIT_data, c("upstream_A1", "downstream_A1"))
Summarizes the time difference between the first and last movement directions for each unique tag ID. Input data are created by tag_direction
, which determines the direction of movement for each detection event in join_multireader_data
.
direction_summary(dir_df, include_stationary = FALSE)
direction_summary(dir_df, include_stationary = FALSE)
dir_df |
output from |
include_stationary |
if TRUE, all detections are summarized. If FALSE, only detections with a known movement direction (up or down) are included in the summary. |
direction_summary
isolates the first and last direction of movement from tag_direction
and determines the time difference in seconds and days. Directions are U for upstream movement, D for downstream movement, and S for no movement, or consecutive detection at the same location.
It is common for a tag to be detected multiple times at the same antenna, which will result in a movement direction of S, or stationary. The user is encouraged to examine direction summaries for include_stationary = TRUE and include_stationary = FALSE to become familiar with their data. When include_stationary = FALSE, there may be fewer tag ids in the direction summary than in the full data set.
Returns a tibble object.
Annika Putt <[email protected]>
import_ORFID
for importing data files from Oregon RFID ORMR and ORSR antenna readers.
join_multireader_data
for combining data from Oregon RFID ORMR and ORSR antenna readers into a multi-reader array.
tag_direction
for determining movement direction of detections in systems with a linear migration route.
# Create a list containing compiled reader data: readers <- list(reader_us, reader_ds) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers) # List readers: unique(PIT_data$LOC) # Determine tag direction for animals moving from downstream to upstream: dir <- tag_direction(PIT_data, c("downstream_A1", "upstream_A1")) # Determine the time difference between first and last detections: dir_summary <- direction_summary(dir)
# Create a list containing compiled reader data: readers <- list(reader_us, reader_ds) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers) # List readers: unique(PIT_data$LOC) # Determine tag direction for animals moving from downstream to upstream: dir <- tag_direction(PIT_data, c("downstream_A1", "upstream_A1")) # Determine the time difference between first and last detections: dir_summary <- direction_summary(dir)
Data compiled using import_ORFID
or join_multireader_data
are exported to the working directory as either a .csv or .xlsx file
export_ORFID(x, name, extension)
export_ORFID(x, name, extension)
x |
data frame to be exported. |
name |
file name. |
extension |
file extension (".csv" or ".xlsx"). |
Any data frame created using functions in the ORFID package can be exported using this function.
A file is saved to the working directory.
Hugo Marques <[email protected]>
import_ORFID
for importing data files from Oregon RFID ORMR and ORSR antenna readers.
join_multireader_data
for combining data from Oregon RFID ORMR and ORSR antenna readers into a multi-reader array.
Function to return field names and descriptions from Oregon RFID single readers (ORSR) and multi-readers (ORMR).
field_names()
field_names()
Returns the field/column names and its details from ORSR and ORMR data, which can be used to determine which field names should be included in data downloads.
A data frame with two variables: name and details
Hugo Marques <[email protected]>
field_names()
field_names()
Only data collected using Oregon RFID (radio-frequency identification) ORMR (Oregon RFID Multi-Reader) and ORSR (Oregon RFID Single Reader) antenna readers can be imported using import_ORFID
. Data from previous generations of readers must be imported using import_old_readers
. Only detections are retained during compilation (events are removed).
This function will only work with raw data downloaded directly from Oregon RFID stationary readers. The files must be delimited (tab, comma, or semicolon) and unedited by the user.
import_old_readers(file, delim, verbose = FALSE)
import_old_readers(file, delim, verbose = FALSE)
file |
.txt file generated by an Oregon RFID reader. |
delim |
field/column delimiter, which must be tab ('\t'), comma (',') or semi-colon (';'). |
verbose |
If TRUE, a description of the compiled data is printed to the console. |
The field/column delimiter must be tab, comma or semi-colon for data compilation and further analysis. The function cannot be used for space delimited data.
Data compiled using import_ORFID
and import_old_readers
can be joined together using join_multireader_data
.
Note that corruption may occur in reader data files. Check your data files and compiled data carefully to ensure accuracy.
Returns a tibble object.
Hugo Marques <[email protected]>
# Import a single comma-deliminated data file from an old ORFID reader import_old_readers(file = system.file("extdata/orfid_old_data_file.txt", package = "ORFID"), delim = ",")
# Import a single comma-deliminated data file from an old ORFID reader import_old_readers(file = system.file("extdata/orfid_old_data_file.txt", package = "ORFID"), delim = ",")
Imports files from Oregon RFID (radio-frequency identification) ORMR (Oregon RFID Multi-Reader) and ORSR (Oregon RFID Single Reader) antenna readers. Only detections are retained during compilation (events are removed).
This function will only work with raw data downloaded directly from Oregon RFID stationary readers. The files must be delimited (tab, comma, or semicolon) and unedited by the user.
import_ORFID(file, delim, verbose = FALSE)
import_ORFID(file, delim, verbose = FALSE)
file |
.txt file generated by an Oregon RFID reader. |
delim |
field/column delimiter, which must be tab ('\t'), comma (',') or semi-colon (';'). |
verbose |
If TRUE, a description of the compiled data is printed to the console. |
The field/column delimiter must be tab, comma or semi-colon for data compilation and further analysis. The function cannot be used for space delimited data.
The tag number column (TAG) is required for subsequent analyses, and the function will return a warning if TAG is not included in the data file.
Note that corruption may occur in reader data files. Check your data files and compiled data carefully to ensure accuracy.
Returns a tibble object of data compiled from a single ORFID data file.
Hugo Marques <[email protected]>, Annika Putt <[email protected]>
# Import a single tab-deliminated data file from an ORFID reader import_ORFID(file = system.file("extdata/orfid_data_file.txt", package = "ORFID"), delim = "\t")
# Import a single tab-deliminated data file from an ORFID reader import_ORFID(file = system.file("extdata/orfid_data_file.txt", package = "ORFID"), delim = "\t")
Imports files from Oregon RFID (radio-frequency identification) ORMR (Oregon RFID Multi-Reader) and ORSR (Oregon RFID Single Reader) antenna readers. Only event records are retained during compilation (detections are removed). The function will not work with older generations of Oregon RFID antenna readers.
This function will only work with raw data downloaded directly from Oregon RFID stationary readers. The files must be delimited (tab, comma, or semicolon) and unedited by the user.
import_ORFID_events(file, delim, verbose = FALSE)
import_ORFID_events(file, delim, verbose = FALSE)
file |
.txt file generated by an Oregon RFID reader. |
delim |
field/column delimiter, which must be tab ('\t'), comma (',') or semi-colon (';'). |
verbose |
If TRUE, a description of the compiled data is printed to the console. |
The field/column delimiter must be tab, comma or semi-colon for data compilation. The function cannot be used for space delimited data.
Returns a tibble object.
Hugo Marques <[email protected]>
# Importing event records from a single ORFID reader import_ORFID_events(file = system.file("extdata/orfid_data_file.txt", package = "ORFID"), delim = "\t")
# Importing event records from a single ORFID reader import_ORFID_events(file = system.file("extdata/orfid_data_file.txt", package = "ORFID"), delim = "\t")
Function to combine data from unique readers into an array, using reader data compiled using import_ORFID
.
join_multireader_data(x, verbose = FALSE)
join_multireader_data(x, verbose = FALSE)
x |
A list object containing data frames compiled using |
verbose |
If TRUE, a description of the compiled data is printed to the console. |
As in bind_rows
, the output of join_multireader_data
will contain a column if that column appears in any of the data inputs. The function creates a unique factor variable, LOC (location), which is a combination of SCD (site code) and ANT (antenna).
Returns a tibble object of distinct detections from multiple antenna readers.
Hugo Marques <[email protected]>
import_ORFID
for importing data files from Oregon RFID ORMR and ORSR antenna readers.
# Create a list containing compiled reader data: readers <- list(reader_1, reader_2) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers)
# Create a list containing compiled reader data: readers <- list(reader_1, reader_2) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers)
Creates a filtered dataset containing only detection data from a user-specified marker tag (unique tag number).
marker_tag(x, tag, gap)
marker_tag(x, tag, gap)
x |
antenna data compiled using |
tag |
marker tag identification (character object). |
gap |
minimum time gap in seconds between detections (optional). |
A column, GAP, is created that calculates the time gap (in seconds) between subsequent detections. If GAP is omitted, all detection from the marker tag are retained. If a minimum time gap is specified, only detections with a larger time gap than the specified minimum are retained. This allows the user to identify periods when marker tags were not being detected as frequently as expected.
Returns a tibble object.
Hugo Marques <[email protected]>
import_ORFID
for importing data files from Oregon RFID ORMR and ORSR antenna readers.
join_multireader_data
for combining data from Oregon RFID ORMR and ORSR antenna readers into a multi-reader array.
# Create a list containing compiled reader data: readers <- list(reader_1, reader_2, reader_3) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers) # Summarize marker tag data marker_tag(PIT_data, "0000_000000004978") # Summarize marker tag data when the time gap between detections was greater or equal to 10 minutes. marker_tag(PIT_data, "0000_000000004978", gap = 600)
# Create a list containing compiled reader data: readers <- list(reader_1, reader_2, reader_3) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers) # Summarize marker tag data marker_tag(PIT_data, "0000_000000004978") # Summarize marker tag data when the time gap between detections was greater or equal to 10 minutes. marker_tag(PIT_data, "0000_000000004978", gap = 600)
Creates a time series plot containing only detection data from a user-specified marker tag (unique tag number).
marker_tag_plot(x, tag, gap)
marker_tag_plot(x, tag, gap)
x |
antenna data compiled using |
tag |
marker tag identification (character object). |
gap |
minimum time gap in seconds between detections (optional). |
Creates a plot object displaying marker tag detections. If a minimum time gap is specified, time gaps greater than the minimum specified are highlighted in red. This allows the user to identify periods when marker tags were not being detected as frequently as expected.
Returns a ggplot2 object. If the plot is saved as a named object, ggplot2 functions, including theme
commands can be used to customize plot aesthetics, including axis labels, grid lines, etc.
Hugo Marques <[email protected]>
import_ORFID
for importing data files from Oregon RFID ORMR and ORSR antenna readers.
join_multireader_data
for combining data from Oregon RFID ORMR and ORSR antenna readers into a multi-reader array.
# Create a list containing compiled reader data: readers <- list(reader_1, reader_2, reader_3) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers) # Plot marker tag data and highlight gaps greater than 10 minutes. marker_tag_plot(PIT_data, "0000_000000004978", gap = 600)
# Create a list containing compiled reader data: readers <- list(reader_1, reader_2, reader_3) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers) # Plot marker tag data and highlight gaps greater than 10 minutes. marker_tag_plot(PIT_data, "0000_000000004978", gap = 600)
Compiled data to illustrate functions from ORFID. The variables are as follows:
reader_1
reader_1
A data frame with 8590 rows and 9 variables:
Detection type (S = summary, I = individual, E = event)
Arrival date and time
Time reference (G = GNSS, N = network, U = unreferenced)
Duration of the period between the arrival and the departure from the detection zone
Tag type A=Animal (R = Read only, W = Writeable, P = Phantom)
Tag ID number
Site code
Number of consecutive detections
Effective amps
Compiled data to illustrate functions from ORFID. The variables are as follows:
reader_2
reader_2
A data frame with 8590 rows and 9 variables:
Detection type (S = summary, I = individual, E = event)
Arrival date and time
Time reference (G = GNSS, N = network, U = unreferenced)
Duration of the period between the arrival and the departure from the detection zone
Tag type A=Animal (R = Read only, W = Writeable, P = Phantom)
Tag ID number
Site code
Number of consecutive detections
Effective amps
Compiled data to illustrate functions from ORFID. The variables are as follows:
reader_3
reader_3
A data frame with 1034 rows and 9 variables:
Detection type (S = summary, I = individual, E = event)
Arrival date and time
Time reference (G = GNSS, N = network, U = unreferenced)
Duration of the period between the arrival and the departure from the detection zone
Tag type A=Animal (R = Read only, W = Writeable, P = Phantom)
Tag ID number
Site code
Number of consecutive detections
Effective amps
Compiled data to illustrate directional functions from ORFID. The variables are as follows:
reader_ds
reader_ds
A data frame with 824 rows and 16 variables:
Detection type (S = summary, I = individual, E = event)
Arrival date and time
Time reference (G = GNSS, N = network, U = unreferenced)
Duration of the period between the arrival and the departure from the detection zone
Tag type A=Animal (R = Read only, W = Writeable, P = Phantom)
Tag ID number
Site code
Number of consecutive detections
Effective amps
Tag technology (HDX, FDX, HF)
Antenna number
Number of empty scans preceding detection
Tag signal strength
Unknown
Noise
Tag class
Compiled data to illustrate directional functions from ORFID. The variables are as follows:
reader_us
reader_us
A data frame with 781 rows and 16 variables:
Detection type (S = summary, I = individual, E = event)
Arrival date and time
Time reference (G = GNSS, N = network, U = unreferenced)
Duration of the period between the arrival and the departure from the detection zone
Tag type A=Animal (R = Read only, W = Writeable, P = Phantom)
Tag ID number
Site code
Number of consecutive detections
Effective amps
Tag technology (HDX, FDX, HF)
Antenna number
Number of empty scans preceding detection
Tag signal strength
Unknown
Noise
Tag class
Summarizes detection information for unique antenna sites within antenna reader data compiled using import_ORFID
or join_multireader_data
.
site_summary(x)
site_summary(x)
x |
antenna data compiled using |
Creates a tibble grouped by SCD (site code; one row per unique SCD). The data frame contains the site code (SCD), the total number of records detected (REC), the number of unique tags detected (TAG_ID), and the time at which the first (FIR) and last (LAS) detections occurred on the array.
Returns a tibble object.
Hugo Marques <[email protected]>
import_ORFID
for importing data files from Oregon RFID ORMR and ORSR antenna readers.
join_multireader_data
for combining data from Oregon RFID ORMR and ORSR antenna readers into a multi-reader array.
# Create a list containing compiled reader data: readers <- list(reader_1, reader_2) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers) # Summarize detection information for each unique site: site_summary(PIT_data)
# Create a list containing compiled reader data: readers <- list(reader_1, reader_2) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers) # Summarize detection information for each unique site: site_summary(PIT_data)
Creates a time series plot containing start and stop times from Oregon RFID (radio-frequency identification) ORMR (Oregon RFID multi-reader) and ORSR (Oregon RFID single reader) antenna readers.
start_stop_plot(x)
start_stop_plot(x)
x |
event data compiled using |
Creates a plot displaying reader start and stop times. Note that start and stop times can be very close together and difficult to distinguish depending on the period plotted. Filter event data to improve resolution.
Returns a plot object.
Annika Putt <[email protected]>
import_ORFID_events
for importing event data from Oregon RFID ORMR and ORSR antenna readers.
join_multireader_data
for combining data from Oregon RFID ORMR and ORSR antenna readers into a multi-reader array.
Determines direction of tag movement in systems where multiple antennas are used along a linear migration route.
tag_direction(x, LOC_vec)
tag_direction(x, LOC_vec)
x |
data frame generated using |
LOC_vec |
vector of antenna locations from first encountered to last encountered. |
tag_direction
determines the direction of movement for individual detection events in x. Direction is determined based on the order of locations from first encountered to last encountered, as specified in LOC_vec. Note that direction cannot be determined until the tag has been detected at multiple locations. Use site_summary
to identify all locations present in the multi-reader data, which must be included in LOC_vec.
Returns a tibble object. The column DIR displays direction, where U is upstream movement, D is downstream movement, and S is no movement, or a consecutive detection at the previous location.
Annika Putt <[email protected]>
import_ORFID
for importing data files from Oregon RFID ORMR and ORSR antenna readers.
join_multireader_data
for combining data from Oregon RFID ORMR and ORSR antenna readers into a multi-reader array.
site_summary
for identifying all locations present in a multi reader array
# Create a list containing compiled reader data: readers <- list(reader_us, reader_ds) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers) # List readers: unique(PIT_data$LOC) # Determine tag direction for animals moving from downstream to upstream: tag_direction(PIT_data, c("downstream_A1", "upstream_A1"))
# Create a list containing compiled reader data: readers <- list(reader_us, reader_ds) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers) # List readers: unique(PIT_data$LOC) # Determine tag direction for animals moving from downstream to upstream: tag_direction(PIT_data, c("downstream_A1", "upstream_A1"))
Summarizes detection information for unique tags within antenna reader data compiled using import_ORFID
or join_multireader_data
.
tag_summary(x, verbose = TRUE)
tag_summary(x, verbose = TRUE)
x |
antenna data compiled using |
verbose |
If TRUE, a data frame describing output columns is printed to the console. |
Creates a tibble grouped by TAG (one row per unique TAG). A data frame describing the summarized data is printed to the console.
Returns a tibble object.
Hugo Marques <[email protected]>
import_ORFID
for importing data files from Oregon RFID ORMR and ORSR antenna readers.
join_multireader_data
for combining data from Oregon RFID ORMR and ORSR antenna readers into a multi-reader array.
# Create a list containing compiled reader data: readers <- list(reader_1, reader_2) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers) # Summarize detection information for each unique tag: tag_summary(PIT_data)
# Create a list containing compiled reader data: readers <- list(reader_1, reader_2) # Join data into a multi-reader array: PIT_data <- join_multireader_data(readers) # Summarize detection information for each unique tag: tag_summary(PIT_data)