Get data for acoustic detections, with options to filter results. Use
limit
to limit the number of returned records.
Usage
get_acoustic_detections(
connection = con,
start_date = NULL,
end_date = NULL,
acoustic_tag_id = NULL,
animal_project_code = NULL,
scientific_name = NULL,
acoustic_project_code = NULL,
receiver_id = NULL,
station_name = NULL,
limit = FALSE
)
Arguments
- connection
A connection to the ETN database. Defaults to
con
.- start_date
Character. Start date (inclusive) in ISO 8601 format (
yyyy-mm-dd
,yyyy-mm
oryyyy
).- end_date
Character. End date (exclusive) in ISO 8601 format (
yyyy-mm-dd
,yyyy-mm
oryyyy
).- acoustic_tag_id
Character (vector). One or more acoustic tag ids.
- animal_project_code
Character (vector). One or more animal project codes. Case-insensitive.
- scientific_name
Character (vector). One or more scientific names.
- acoustic_project_code
Character (vector). One or more acoustic project codes. Case-insensitive.
- receiver_id
Character (vector). One or more receiver identifiers.
- station_name
Character (vector). One or more deployment station names.
- limit
Logical. Limit the number of returned records to 100 (useful for testing purposes). Defaults to
FALSE
.
Value
A tibble with acoustic detections data, sorted by acoustic_tag_id
and date_time
. See also
field definitions.
Examples
# Set default connection variable
con <- connect_to_etn()
#> Error: nanodbc/nanodbc.cpp:1135: 00000: [unixODBC][Driver Manager]Data source name not found and no default driver specified
# Get limited sample of acoustic detections
get_acoustic_detections(con, limit = TRUE)
#> Error in methods::is(connection, "PostgreSQL"): object 'con' not found
# Get all acoustic detections from a specific animal project
get_acoustic_detections(con, animal_project_code = "2014_demer")
#> Error in methods::is(connection, "PostgreSQL"): object 'con' not found
# Get 2015 acoustic detections from that animal project
get_acoustic_detections(
con,
animal_project_code = "2014_demer",
start_date = "2015",
end_date = "2016",
)
#> Error in methods::is(connection, "PostgreSQL"): object 'con' not found
# Get April 2015 acoustic detections from that animal project
get_acoustic_detections(
con,
animal_project_code = "2014_demer",
start_date = "2015-04",
end_date = "2015-05",
)
#> Error in methods::is(connection, "PostgreSQL"): object 'con' not found
# Get April 24, 2015 acoustic detections from that animal project
get_acoustic_detections(
con,
animal_project_code = "2014_demer",
start_date = "2015-04-24",
end_date = "2015-04-25",
)
#> Error in methods::is(connection, "PostgreSQL"): object 'con' not found
# Get acoustic detections for a specific tag at two specific stations
get_acoustic_detections(
con,
acoustic_tag_id = "A69-1601-16130",
station_name = c("de-9", "de-10")
)
#> Error in methods::is(connection, "PostgreSQL"): object 'con' not found
# Get acoustic detections for a specific species, receiver and acoustic project
get_acoustic_detections(
con,
scientific_name = "Rutilus rutilus",
receiver_id = "VR2W-124070",
acoustic_project_code = "demer"
)
#> Error in methods::is(connection, "PostgreSQL"): object 'con' not found