AtlasOfLivingAustralia / galah-R

Query living atlases from R
https://galah.ala.org.au
38 stars 3 forks source link

Option to support extensions of `dplyr` verbs in `galah` #161

Closed mjwestgate closed 1 year ago

mjwestgate commented 1 year ago

At a recent webinar, @huizezhang-sherry suggested that we could implement extensions dplyr functions pretty easily, given that our functions use the same methods and terminology anyway. E.g. instead of:

galah_call() |> 
  galah_filter(year >= 2020) |>
  atlas_counts()

We could then use:

galah_call() |> 
  filter(year >= 2020) |>
  atlas_counts()

The approach is documented here.

Some other thoughts:

mjwestgate commented 1 year ago

Note to self to support slice_head() to atlas_occurrences() using pageSize arg in new API. Using the start arg it might be possible to support slice() as well.

On a related note; technically we've implemented slice_max() so far, despite calling it slice_head(), because solr ranks in decreasing order of count by default. To choose between these would could use fsort=count for slice_max() or fsort=index for slice_head(). Optionally we could add dir=asc to implement slice_min() & slice_tail()

mjwestgate commented 1 year ago

complete