View source: R/proc-real_sensor_values.r
real_sensor_values | R Documentation |
Get transmitter sensor (e.g., depth, temperature) conversion parameters (e.g., intercept, slope) from a Vemco transmitter specification object (e.g., from read_vemco_tag_specs, calculate 'real'-scale values (e.g., depth in meters), and add real values to detection data in a new column.
real_sensor_values(det, tag_specs)
det |
A OR A data frame containing detection data with the following columns:
|
tag_specs |
An object produced by read_vemco_tag_specs. OR A data frame containing transmitter specification data with the following columns:
The following columns are also required for depth and temperature sensors:
The following columns are also required for acceleration sensors:
|
Tag spec data are joined to detection data and then raw-scale sensor measurements are converted to real-scale using sensor_value_real = sensor_intercept + (sensor_value * sensor_slope), where sensor_value is in raw scale.
It is possible that transmitter_codespace
and
transmitter_id
are not unique among transmitters, so users must
ensure that the each combination of those columns occurs only once in
tag_specs
and is the correct record for the corresponding tags in
det
.
The input data frame, data.table, or tibble with the following columns added (see column descriptions above):
sensor_range
sensor_units
sensor_slope
sensor_intercept
accel_algorithm
accel_sample_rate
sensor_transmit_ratio
sensor_value_real
Chris Holbrook, cholbrook@usgs.gov
#get path to example detection file det_file <- system.file("extdata", "lamprey_detections.csv", package="glatos") lamprey_detections <- read_glatos_detections(det_file) #get path to example Vemco tag spec file spec_file <- system.file("extdata", "lamprey_tag_specs.xls", package="glatos") lamprey_tags <- read_vemco_tag_specs(spec_file, file_format = "vemco_xls") #note use of '$specs' in tag_specs argument dtc <- real_sensor_values(lamprey_detections, lamprey_tags$specs) #now view records with sensor measurements dtc[!is.na(dtc$sensor_value_real),]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.