AtlasOfLivingAustralia / galah-R

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

Make syntax more consistent with expected function behaviour #112

Closed daxkellie closed 2 years ago

daxkellie commented 2 years ago

In the current version of galah, functions that manipulated or built queries were identified with a select_ prefix (i.e., select_taxa, select_filters, select_locations). With the changes to make syntax more consistent with dplyr filter, select and group_by (#101 ), this makes the syntax of select_taxa an outlier because it does not select columns (which is now what galah_select does).

After discussion, we decided that select_taxa is really a search function and should be renamed search_taxa, consistent with the existing search_fields function. Expected output of search_ functions will be made consistent as well.

Discussion also identified that the difference between search_ functions and find_ functions is ambiguous to the user, but most find_ functions return a data.frame of possible values. However, not all find_ functions accept a blank argument (e.g., find_field_values and find_profile_attributes). To remedy this inconsistent syntax to match their expected behaviour, functions that accept a blank argument and return a data.frame of possible values will be prefixed by show_all_:

show_all_fields()
show_all_reasons()
show_all_profiles()
show_all_ranks()
show_all_atlases()