Skip to contents

Get data for animals, with options to filter results. Associated tag information is available in columns starting with tag and acoustic_tag_id. If multiple tags are associated with a single animal, the information is comma-separated.

Usage

get_animals(
  connection = con,
  animal_id = NULL,
  tag_serial_number = NULL,
  animal_project_code = NULL,
  scientific_name = NULL
)

Arguments

connection

A connection to the ETN database. Defaults to con.

animal_id

Integer (vector). One or more animal identifiers.

tag_serial_number

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

animal_project_code

Character (vector). One or more animal project codes. Case-insensitive.

scientific_name

Character (vector). One or more scientific names.

Value

A tibble with animals data, sorted by animal_project_code, release_date_time and tag_serial_number. See also field definitions.

Examples

# Set default connection variable
con <- connect_to_etn()

# Get all animals
get_animals(con)
#> # A tibble: 17,813 × 66
#>    animal_id animal_pr…¹ tag_s…² tag_t…³ tag_s…⁴ acous…⁵ acous…⁶ scien…⁷ commo…⁸
#>        <int> <chr>       <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>  
#>  1      5923 2004_Gudena 1208    acoust… animal  A69-10… R256-1… Anguil… NA     
#>  2      5924 2004_Gudena 1209    acoust… animal  A69-10… R256-1… Anguil… NA     
#>  3      5915 2004_Gudena 7416    acoust… animal  A69-10… R256-74 Anguil… NA     
#>  4      5916 2004_Gudena 7417    acoust… animal  A69-10… R256-75 Anguil… NA     
#>  5      5917 2004_Gudena 7418    acoust… animal  A69-10… R256-76 Anguil… NA     
#>  6      5918 2004_Gudena 7419    acoust… animal  A69-10… R256-77 Anguil… NA     
#>  7      5919 2004_Gudena 7420    acoust… animal  A69-10… R256-78 Anguil… NA     
#>  8      5920 2004_Gudena 7421    acoust… animal  A69-10… R256-79 Anguil… NA     
#>  9      5921 2004_Gudena 7422    acoust… animal  A69-10… R256-80 Anguil… NA     
#> 10      5922 2004_Gudena 7423    acoust… animal  A69-10… R256-81 Anguil… NA     
#> # … with 17,803 more rows, 57 more variables: aphia_id <int>,
#> #   animal_label <chr>, animal_nickname <chr>, tagger <chr>,
#> #   capture_date_time <dttm>, capture_location <chr>, capture_latitude <dbl>,
#> #   capture_longitude <dbl>, capture_method <chr>, capture_depth <chr>,
#> #   capture_temperature_change <chr>, release_date_time <dttm>,
#> #   release_location <chr>, release_latitude <dbl>, release_longitude <dbl>,
#> #   recapture_date_time <dttm>, length1_type <chr>, length1 <dbl>, …

# Get specific animals
get_animals(con, animal_id = 305) # Or string value "305"
#> # A tibble: 1 × 66
#>   animal_id animal_pro…¹ tag_s…² tag_t…³ tag_s…⁴ acous…⁵ acous…⁶ scien…⁷ commo…⁸
#>       <int> <chr>        <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>  
#> 1       305 2014_demer   1187450 acoust… animal  A69-16… ""      Rutilu… roach  
#> # … with 57 more variables: aphia_id <int>, animal_label <chr>,
#> #   animal_nickname <chr>, tagger <chr>, capture_date_time <dttm>,
#> #   capture_location <chr>, capture_latitude <dbl>, capture_longitude <dbl>,
#> #   capture_method <chr>, capture_depth <chr>,
#> #   capture_temperature_change <chr>, release_date_time <dttm>,
#> #   release_location <chr>, release_latitude <dbl>, release_longitude <dbl>,
#> #   recapture_date_time <dttm>, length1_type <chr>, length1 <dbl>, …
get_animals(con, animal_id = c(304, 305, 2827))
#> # A tibble: 3 × 66
#>   animal_id animal_pro…¹ tag_s…² tag_t…³ tag_s…⁴ acous…⁵ acous…⁶ scien…⁷ commo…⁸
#>       <int> <chr>        <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>  
#> 1       304 2014_demer   1187449 acoust… animal  A69-16… ""      Rutilu… roach  
#> 2       305 2014_demer   1187450 acoust… animal  A69-16… ""      Rutilu… roach  
#> 3      2827 2015_phd_ve… 127105… acoust… animal… A69-90… ","     Gadus … Atlant…
#> # … with 57 more variables: aphia_id <int>, animal_label <chr>,
#> #   animal_nickname <chr>, tagger <chr>, capture_date_time <dttm>,
#> #   capture_location <chr>, capture_latitude <dbl>, capture_longitude <dbl>,
#> #   capture_method <chr>, capture_depth <chr>,
#> #   capture_temperature_change <chr>, release_date_time <dttm>,
#> #   release_location <chr>, release_latitude <dbl>, release_longitude <dbl>,
#> #   recapture_date_time <dttm>, length1_type <chr>, length1 <dbl>, …

# Get animals from specific animal project(s)
get_animals(con, animal_project_code = "2014_demer")
#> # A tibble: 16 × 66
#>    animal_id animal_pr…¹ tag_s…² tag_t…³ tag_s…⁴ acous…⁵ acous…⁶ scien…⁷ commo…⁸
#>        <int> <chr>       <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>  
#>  1       304 2014_demer  1187449 acoust… animal  A69-16… ""      Rutilu… roach  
#>  2       384 2014_demer  1157781 acoust… animal  A69-16… ""      Siluru… wels c…
#>  3       385 2014_demer  1157782 acoust… animal  A69-16… ""      Siluru… wels c…
#>  4       386 2014_demer  1157783 acoust… animal  A69-16… ""      Siluru… wels c…
#>  5       305 2014_demer  1187450 acoust… animal  A69-16… ""      Rutilu… roach  
#>  6       383 2014_demer  1157780 acoust… animal  A69-16… ""      Squali… chub   
#>  7       369 2014_demer  1171781 acoust… animal  A69-16… ""      Siluru… wels c…
#>  8       370 2014_demer  1171782 acoust… animal  A69-16… ""      Siluru… wels c…
#>  9       365 2014_demer  1171775 acoust… animal  A69-16… ""      Siluru… wels c…
#> 10       366 2014_demer  1171776 acoust… animal  A69-16… ""      Siluru… wels c…
#> 11       368 2014_demer  1171780 acoust… animal  A69-16… ""      Siluru… wels c…
#> 12       382 2014_demer  1157779 acoust… animal  A69-16… ""      Squali… chub   
#> 13       371 2014_demer  1171783 acoust… animal  A69-16… ""      Petrom… sea la…
#> 14       372 2014_demer  1171784 acoust… animal  A69-16… ""      Squali… chub   
#> 15       367 2014_demer  1171777 acoust… animal  A69-16… ""      Siluru… wels c…
#> 16       306 2014_demer  1187468 acoust… animal  A69-16… ""      Petrom… sea la…
#> # … with 57 more variables: aphia_id <int>, animal_label <chr>,
#> #   animal_nickname <chr>, tagger <chr>, capture_date_time <dttm>,
#> #   capture_location <chr>, capture_latitude <dbl>, capture_longitude <dbl>,
#> #   capture_method <chr>, capture_depth <chr>,
#> #   capture_temperature_change <chr>, release_date_time <dttm>,
#> #   release_location <chr>, release_latitude <dbl>, release_longitude <dbl>,
#> #   recapture_date_time <dttm>, length1_type <chr>, length1 <dbl>, …
get_animals(con, animal_project_code = c("2014_demer", "2015_dijle"))
#> # A tibble: 42 × 66
#>    animal_id animal_pr…¹ tag_s…² tag_t…³ tag_s…⁴ acous…⁵ acous…⁶ scien…⁷ commo…⁸
#>        <int> <chr>       <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>  
#>  1       304 2014_demer  1187449 acoust… animal  A69-16… ""      Rutilu… roach  
#>  2       384 2014_demer  1157781 acoust… animal  A69-16… ""      Siluru… wels c…
#>  3       385 2014_demer  1157782 acoust… animal  A69-16… ""      Siluru… wels c…
#>  4       386 2014_demer  1157783 acoust… animal  A69-16… ""      Siluru… wels c…
#>  5       305 2014_demer  1187450 acoust… animal  A69-16… ""      Rutilu… roach  
#>  6       383 2014_demer  1157780 acoust… animal  A69-16… ""      Squali… chub   
#>  7       369 2014_demer  1171781 acoust… animal  A69-16… ""      Siluru… wels c…
#>  8       370 2014_demer  1171782 acoust… animal  A69-16… ""      Siluru… wels c…
#>  9       365 2014_demer  1171775 acoust… animal  A69-16… ""      Siluru… wels c…
#> 10       366 2014_demer  1171776 acoust… animal  A69-16… ""      Siluru… wels c…
#> # … with 32 more rows, 57 more variables: aphia_id <int>, animal_label <chr>,
#> #   animal_nickname <chr>, tagger <chr>, capture_date_time <dttm>,
#> #   capture_location <chr>, capture_latitude <dbl>, capture_longitude <dbl>,
#> #   capture_method <chr>, capture_depth <chr>,
#> #   capture_temperature_change <chr>, release_date_time <dttm>,
#> #   release_location <chr>, release_latitude <dbl>, release_longitude <dbl>,
#> #   recapture_date_time <dttm>, length1_type <chr>, length1 <dbl>, …

# Get animals associated with a specific tag_serial_number
get_animals(con, tag_serial_number = "1187450")
#> # A tibble: 1 × 66
#>   animal_id animal_pro…¹ tag_s…² tag_t…³ tag_s…⁴ acous…⁵ acous…⁶ scien…⁷ commo…⁸
#>       <int> <chr>        <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>  
#> 1       305 2014_demer   1187450 acoust… animal  A69-16… ""      Rutilu… roach  
#> # … with 57 more variables: aphia_id <int>, animal_label <chr>,
#> #   animal_nickname <chr>, tagger <chr>, capture_date_time <dttm>,
#> #   capture_location <chr>, capture_latitude <dbl>, capture_longitude <dbl>,
#> #   capture_method <chr>, capture_depth <chr>,
#> #   capture_temperature_change <chr>, release_date_time <dttm>,
#> #   release_location <chr>, release_latitude <dbl>, release_longitude <dbl>,
#> #   recapture_date_time <dttm>, length1_type <chr>, length1 <dbl>, …

# Get animals of specific species (across all projects)
get_animals(con, scientific_name = c("Rutilus rutilus", "Silurus glanis"))
#> # A tibble: 66 × 66
#>    animal_id animal_pr…¹ tag_s…² tag_t…³ tag_s…⁴ acous…⁵ acous…⁶ scien…⁷ commo…⁸
#>        <int> <chr>       <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>  
#>  1       304 2014_demer  1187449 acoust… animal  A69-16… ""      Rutilu… roach  
#>  2       384 2014_demer  1157781 acoust… animal  A69-16… ""      Siluru… wels c…
#>  3       385 2014_demer  1157782 acoust… animal  A69-16… ""      Siluru… wels c…
#>  4       386 2014_demer  1157783 acoust… animal  A69-16… ""      Siluru… wels c…
#>  5       305 2014_demer  1187450 acoust… animal  A69-16… ""      Rutilu… roach  
#>  6       369 2014_demer  1171781 acoust… animal  A69-16… ""      Siluru… wels c…
#>  7       370 2014_demer  1171782 acoust… animal  A69-16… ""      Siluru… wels c…
#>  8       365 2014_demer  1171775 acoust… animal  A69-16… ""      Siluru… wels c…
#>  9       366 2014_demer  1171776 acoust… animal  A69-16… ""      Siluru… wels c…
#> 10       368 2014_demer  1171780 acoust… animal  A69-16… ""      Siluru… wels c…
#> # … with 56 more rows, 57 more variables: aphia_id <int>, animal_label <chr>,
#> #   animal_nickname <chr>, tagger <chr>, capture_date_time <dttm>,
#> #   capture_location <chr>, capture_latitude <dbl>, capture_longitude <dbl>,
#> #   capture_method <chr>, capture_depth <chr>,
#> #   capture_temperature_change <chr>, release_date_time <dttm>,
#> #   release_location <chr>, release_latitude <dbl>, release_longitude <dbl>,
#> #   recapture_date_time <dttm>, length1_type <chr>, length1 <dbl>, …

# Get animals of a specific species from a specific project
get_animals(con, animal_project_code = "2014_demer", scientific_name = "Rutilus rutilus")
#> # A tibble: 2 × 66
#>   animal_id animal_pro…¹ tag_s…² tag_t…³ tag_s…⁴ acous…⁵ acous…⁶ scien…⁷ commo…⁸
#>       <int> <chr>        <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>  
#> 1       304 2014_demer   1187449 acoust… animal  A69-16… ""      Rutilu… roach  
#> 2       305 2014_demer   1187450 acoust… animal  A69-16… ""      Rutilu… roach  
#> # … with 57 more variables: aphia_id <int>, animal_label <chr>,
#> #   animal_nickname <chr>, tagger <chr>, capture_date_time <dttm>,
#> #   capture_location <chr>, capture_latitude <dbl>, capture_longitude <dbl>,
#> #   capture_method <chr>, capture_depth <chr>,
#> #   capture_temperature_change <chr>, release_date_time <dttm>,
#> #   release_location <chr>, release_latitude <dbl>, release_longitude <dbl>,
#> #   recapture_date_time <dttm>, length1_type <chr>, length1 <dbl>, …