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()

# Get all tags
get_tags(con)
#> # A tibble: 50,224 × 54
#>    tag_serial_number tag_type tag_subtype sensor_type acoustic_tag_id
#>    <chr>             <chr>    <chr>       <chr>       <chr>          
#>  1 0A6E              acoustic animal      NA          R64K-2381      
#>  2 0A6F              acoustic animal      NA          R64K-2382      
#>  3 0A6G              acoustic animal      NA          R64K-2383      
#>  4 0A6H              acoustic animal      NA          R64K-2384      
#>  5 0A6I              acoustic animal      NA          R64K-2385      
#>  6 0A6J              acoustic animal      NA          R64K-2386      
#>  7 0A6K              acoustic animal      NA          R64K-2387      
#>  8 0A6L              acoustic animal      NA          R64K-2388      
#>  9 0A6M              acoustic animal      NA          R64K-2389      
#> 10 0A6N              acoustic animal      NA          R64K-2390      
#> # ℹ 50,214 more rows
#> # ℹ 49 more variables: acoustic_tag_id_alternative <chr>, manufacturer <chr>,
#> #   model <chr>, frequency <chr>, status <chr>, activation_date <dttm>,
#> #   battery_estimated_life <chr>, battery_estimated_end_date <dttm>,
#> #   length <dbl>, diameter <dbl>, weight <dbl>, floating <lgl>,
#> #   archive_memory <chr>, sensor_slope <dbl>, sensor_intercept <dbl>,
#> #   sensor_range <chr>, sensor_range_min <dbl>, sensor_range_max <dbl>, …

# Get archival tags, including acoustic-archival
get_tags(con, tag_type = c("archival", "acoustic-archival"))
#> # A tibble: 12,096 × 54
#>    tag_serial_number tag_type          tag_subtype sensor_type acoustic_tag_id
#>    <chr>             <chr>             <chr>       <chr>       <chr>          
#>  1 0AE6              acoustic-archival animal      P           OPS-4207       
#>  2 0AE7              acoustic-archival animal      P           OPS-4208       
#>  3 03DX1083          acoustic-archival animal      PT          OPS-1083       
#>  4 03E01161          acoustic-archival animal      PT          OPS-1161       
#>  5 03E21093          acoustic-archival animal      PT          OPS-1093       
#>  6 03E31095          acoustic-archival animal      PT          OPS-1095       
#>  7 03E41097          acoustic-archival animal      PT          OPS-1097       
#>  8 03E51099          acoustic-archival animal      PT          OPS-1099       
#>  9 03E61101          acoustic-archival animal      PT          OPS-1101       
#> 10 03E71103          acoustic-archival animal      PT          OPS-1103       
#> # ℹ 12,086 more rows
#> # ℹ 49 more variables: acoustic_tag_id_alternative <chr>, manufacturer <chr>,
#> #   model <chr>, frequency <chr>, status <chr>, activation_date <dttm>,
#> #   battery_estimated_life <chr>, battery_estimated_end_date <dttm>,
#> #   length <dbl>, diameter <dbl>, weight <dbl>, floating <lgl>,
#> #   archive_memory <chr>, sensor_slope <dbl>, sensor_intercept <dbl>,
#> #   sensor_range <chr>, sensor_range_min <dbl>, sensor_range_max <dbl>, …

# Get tags of specific subtype
get_tags(con, tag_subtype = c("built-in", "range"))
#> # A tibble: 1,978 × 54
#>    tag_serial_number tag_type          tag_subtype sensor_type acoustic_tag_id
#>    <chr>             <chr>             <chr>       <chr>       <chr>          
#>  1 04HD              acoustic-archival range       P           S64K-9795      
#>  2 04HD              acoustic-archival range       A           S64K-9796      
#>  3 04HE              acoustic-archival range       P           S64K-9797      
#>  4 04HE              acoustic-archival range       A           S64K-9798      
#>  5 04HF              acoustic-archival range       P           S64K-9799      
#>  6 04HF              acoustic-archival range       A           S64K-9800      
#>  7 04HH              acoustic-archival range       P           S64K-9803      
#>  8 04HH              acoustic-archival range       A           S64K-9804      
#>  9 04HI              acoustic-archival range       P           S64K-9805      
#> 10 04HI              acoustic-archival range       A           S64K-9806      
#> # ℹ 1,968 more rows
#> # ℹ 49 more variables: acoustic_tag_id_alternative <chr>, manufacturer <chr>,
#> #   model <chr>, frequency <chr>, status <chr>, activation_date <dttm>,
#> #   battery_estimated_life <chr>, battery_estimated_end_date <dttm>,
#> #   length <dbl>, diameter <dbl>, weight <dbl>, floating <lgl>,
#> #   archive_memory <chr>, sensor_slope <dbl>, sensor_intercept <dbl>,
#> #   sensor_range <chr>, sensor_range_min <dbl>, sensor_range_max <dbl>, …

# Get specific tags (note that these can return multiple records)
get_tags(con, tag_serial_number = "1187450")
#> # A tibble: 1 × 54
#>   tag_serial_number tag_type tag_subtype sensor_type acoustic_tag_id
#>   <chr>             <chr>    <chr>       <chr>       <chr>          
#> 1 1187450           acoustic animal      NA          A69-1601-16130 
#> # ℹ 49 more variables: acoustic_tag_id_alternative <chr>, manufacturer <chr>,
#> #   model <chr>, frequency <chr>, status <chr>, activation_date <dttm>,
#> #   battery_estimated_life <chr>, battery_estimated_end_date <dttm>,
#> #   length <dbl>, diameter <dbl>, weight <dbl>, floating <lgl>,
#> #   archive_memory <chr>, sensor_slope <dbl>, sensor_intercept <dbl>,
#> #   sensor_range <chr>, sensor_range_min <dbl>, sensor_range_max <dbl>,
#> #   sensor_resolution <dbl>, sensor_unit <chr>, sensor_accuracy <dbl>, …
get_tags(con, acoustic_tag_id = "A69-1601-16130")
#> # A tibble: 1 × 54
#>   tag_serial_number tag_type tag_subtype sensor_type acoustic_tag_id
#>   <chr>             <chr>    <chr>       <chr>       <chr>          
#> 1 1187450           acoustic animal      NA          A69-1601-16130 
#> # ℹ 49 more variables: acoustic_tag_id_alternative <chr>, manufacturer <chr>,
#> #   model <chr>, frequency <chr>, status <chr>, activation_date <dttm>,
#> #   battery_estimated_life <chr>, battery_estimated_end_date <dttm>,
#> #   length <dbl>, diameter <dbl>, weight <dbl>, floating <lgl>,
#> #   archive_memory <chr>, sensor_slope <dbl>, sensor_intercept <dbl>,
#> #   sensor_range <chr>, sensor_range_min <dbl>, sensor_range_max <dbl>,
#> #   sensor_resolution <dbl>, sensor_unit <chr>, sensor_accuracy <dbl>, …
get_tags(con, acoustic_tag_id = c("A69-1601-16129", "A69-1601-16130"))
#> # A tibble: 2 × 54
#>   tag_serial_number tag_type tag_subtype sensor_type acoustic_tag_id
#>   <chr>             <chr>    <chr>       <chr>       <chr>          
#> 1 1187449           acoustic animal      NA          A69-1601-16129 
#> 2 1187450           acoustic animal      NA          A69-1601-16130 
#> # ℹ 49 more variables: acoustic_tag_id_alternative <chr>, manufacturer <chr>,
#> #   model <chr>, frequency <chr>, status <chr>, activation_date <dttm>,
#> #   battery_estimated_life <chr>, battery_estimated_end_date <dttm>,
#> #   length <dbl>, diameter <dbl>, weight <dbl>, floating <lgl>,
#> #   archive_memory <chr>, sensor_slope <dbl>, sensor_intercept <dbl>,
#> #   sensor_range <chr>, sensor_range_min <dbl>, sensor_range_max <dbl>,
#> #   sensor_resolution <dbl>, sensor_unit <chr>, sensor_accuracy <dbl>, …