Skip to contents

Get data for tags, with options to filter results. Note that there can be multiple records (acoustic_tag_id) per tag device (tag_serial_number).

Usage

get_tags(
  connection = con,
  tag_type = NULL,
  tag_subtype = NULL,
  tag_serial_number = NULL,
  acoustic_tag_id = NULL
)

Arguments

connection

A connection to the ETN database. Defaults to con.

tag_type

Character (vector). acoustic or archival. Some tags are both, find those with acoustic-archival.

tag_subtype

Character (vector). animal, built-in, range or sentinel.

tag_serial_number

Character (vector). One or more tag serial numbers.

acoustic_tag_id

Character (vector). One or more acoustic tag identifiers, i.e. identifiers found in get_acoustic_detections().

Value

A tibble with tags data, sorted by tag_serial_number. See also field definitions. Values for owner_organization and owner_pi will only be visible if you are member of the group.

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 all tags
get_tags(con)
#> Error in methods::is(connection, "PostgreSQL"): object 'con' not found

# Get archival tags, including acoustic-archival
get_tags(con, tag_type = c("archival", "acoustic-archival"))
#> Error in methods::is(connection, "PostgreSQL"): object 'con' not found

# Get tags of specific subtype
get_tags(con, tag_subtype = c("built-in", "range"))
#> Error in methods::is(connection, "PostgreSQL"): object 'con' not found

# Get specific tags (note that these can return multiple records)
get_tags(con, tag_serial_number = "1187450")
#> Error in methods::is(connection, "PostgreSQL"): object 'con' not found
get_tags(con, acoustic_tag_id = "A69-1601-16130")
#> Error in methods::is(connection, "PostgreSQL"): object 'con' not found
get_tags(con, acoustic_tag_id = c("A69-1601-16129", "A69-1601-16130"))
#> Error in methods::is(connection, "PostgreSQL"): object 'con' not found