Skip to content

get_bibliography() #587

Description

@peterdesmet

While users can now get all citations via get_package(), @CLAUMEMO suggests to also support this for a dataframe of detections users got via get_acoustic_detections().

New function get_bibliography()

Functionality:

my_detections <- get_acoustic_detections(scientific_name = "Mola mola")
get_bibliography(my_detections)
#> item                     type             citation
#> ETN                      data platform    Reubens J, ...
#> etn                      R package        Huybrechts P, ...
#> STRAITS_GIBRALTAR_ANIMAL animal project   ...
#> FISP                     acoustic project ...
#> Haringvliet2023-2026     acoustic project ...

Input

  • A dataframe with detections is expected, but any df with the columns animal_project_code
    and acoustic_project_code is ok.

Error handling

  • Dataframe does not contain the columns animal_project_code and acoustic_project_code.
  • Project codes cannot be found. This is already handled by get_acoustic/animal_projects().

Output

  • A dataframe with 3 columns:
    • item: project code (+ ETN and etn)
    • type: what type of item it is: data platform, R package, animal project, acoustic project`
    • citation: citation returned by cite_imis_dataset()
  • Rows:
    • One row for the ETN data system, with a hardcoded citation
    • One row for the etn R package, with a citation to the latest (non-dev) release
    • One row for each animal project
    • One row for each acoustic project

todo

  • change formatting of etn_citation()
  • consider helper function platform_citation("etn") or data object platform_citation for etn_ref
  • investigate testing warning: invalid 'cutoff' value for 'deparse', using default
  • argument checking: reuse check_value()
  • consider refactoring check_value(): error class + nicer return message: cutoff options, partial matching similar to rlang:::stop_arg_match() using base pmatch().
  • Speed up test via {vcr} or implement caching on cite_imis_dataset()
  • replace etn platform ref with:

Reubens, J., Aarestrup, K., Abecasis, D. et al. The European tracking network through time: united efforts to advance aquatic conservation in Europe. Anim Biotelemetry (2026). https://doi.org/10.1186/s40317-026-00475-z

Updated function get_package()

  • Call get_bibliography() instead of the current code:

    etn/R/get_package.R

    Lines 156 to 160 in e57debd

    references <-
    dplyr::tibble(
    reference_for = c("ETN", animal_project_code, acoustic_project_codes),
    reference = c(etn_ref, animal_ref, acoustic_refs)
    )

  • Rename the resource (and csv) from references to bibliography

  • Update the column names

  • Update field_definitions.tsv

  • Update function definition

  • Update download_acoustic_dataset() function definition (references -> bibliography)

    #' instead, which is more versatile, adds field definition and references, and

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Fields

No fields configured for Feature.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions