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: 20,850 × 54
#>    tag_serial_number tag_type tag_subtype sensor_type acoustic_tag_id
#>    <chr>             <chr>    <chr>       <chr>       <chr>          
#>  1 10                acoustic animal      NA          S256-10-       
#>  2 11                acoustic animal      NA          S256-11-       
#>  3 12                acoustic animal      NA          S256-12-       
#>  4 13                acoustic animal      NA          S256-13-       
#>  5 14                acoustic animal      NA          S256-14-       
#>  6 15                acoustic animal      NA          S256-15-       
#>  7 16                acoustic animal      NA          S256-16-       
#>  8 17                acoustic animal      NA          S256-17-       
#>  9 18                acoustic animal      NA          S256-18-       
#> 10 19                acoustic animal      NA          S256-19-       
#> # … with 20,840 more rows, and 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 <chr>,
#> #   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: 3,769 × 54
#>    tag_serial_number tag_type          tag_subtype sensor_type acoustic_tag_id
#>    <chr>             <chr>             <chr>       <chr>       <chr>          
#>  1 4879H             acoustic-archival animal      NA          A69-1303-533   
#>  2 4880H             acoustic-archival animal      NA          A69-1303-534   
#>  3 4882H             acoustic-archival animal      NA          A69-1303-536   
#>  4 31537             acoustic-archival animal      NA          A69-1604-31537 
#>  5 31538             acoustic-archival animal      NA          A69-1604-31538 
#>  6 31539             acoustic-archival animal      NA          A69-1604-31539 
#>  7 31540             acoustic-archival animal      NA          A69-1604-31540 
#>  8 31541             acoustic-archival animal      NA          A69-1604-31541 
#>  9 31542             acoustic-archival animal      NA          A69-1604-31542 
#> 10 31543             acoustic-archival animal      NA          A69-1604-31543 
#> # … with 3,759 more rows, and 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 <chr>,
#> #   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: 222 × 54
#>    tag_serial_number tag_type tag_subtype sensor_type acoustic_tag_id
#>    <chr>             <chr>    <chr>       <chr>       <chr>          
#>  1 2060              acoustic built-in    NA          R01M-802060    
#>  2 2061              acoustic built-in    NA          R01M-802061    
#>  3 2063              acoustic built-in    NA          R01M-802063    
#>  4 2066              acoustic built-in    NA          R01M-802066    
#>  5 2067              acoustic built-in    NA          R01M-802067    
#>  6 2068              acoustic built-in    NA          R01M-802068    
#>  7 2070              acoustic built-in    NA          R01M-802070    
#>  8 2071              acoustic built-in    NA          R01M-802071    
#>  9 2072              acoustic built-in    NA          R01M-802072    
#> 10 2073              acoustic built-in    NA          R01M-802073    
#> # … with 212 more rows, and 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 <chr>,
#> #   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 
#> # … with 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 <chr>, 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>, …
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 
#> # … with 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 <chr>, 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>, …
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 
#> # … with 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 <chr>, 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>, …