Skip to content

Support show_values() / unnest() for search_taxa() in place of atlas_taxonomy() #277

@mjwestgate

Description

@mjwestgate

The current syntax for getting 'values' from a given system is to use e.g.

search_all(profiles, "ALA") |>
  show_values()

or equivalently:

request_metadata() |>
   filter(profile == "ALA") |>
   unnest() |>
   collect()

This works for fields, lists and profiles at present. It is intended to work for taxa as well, to show child taxa, but doesn't work because of a minor bug (it uses taxon names instead of IDs).

A better way would be for show_values() / unnest() to call the recursive code currently in atlas_taxonomy(), and deprecate the latter. While atlas_taxonomy() has been around a long time, it hasn't been well-supported and is poorly integrated with the rest of the package. It is also conceptually distinct from the other atlas_ functions as being the only one that isn't based on occurrence records. Placing it as a sub-function under search_taxa() would be tidier and more consistent with other metadata-related functions.

By default this would only call one set of child taxa; but perhaps we could add a lowest_rank argument or similar that would support recursion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionUnclear what is the best way forward

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions