AtlasOfLivingAustralia / galah-R

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

No way to filter by emptiness; e.g. include only rows that have a value in a specified field #143

Closed mjwestgate closed 1 year ago

mjwestgate commented 2 years ago

A common complaint is that galah returns records that have empty values for specified fields. For example:

galah_call() |>
  galah_filter(year >= 2015) |>
  galah_select(species, basisOfRecord) |>
  atlas_occurrences()

...might contain rows with no species name. According to this stack overflow post, the way to enforce that a field should be 'filled' is with a query like (field:*); but the equivalent call in galah is galah_filter(field == *), which fails because it's an invalid equation. A solution would be to hack the 'expected' behaviour of galah_filter so it does what we want, e.g.: