Learn R Programming

galah (version 2.1.2)

show_values: Show or search for values within a specified field

Description

Users may wish to see the specific values within a chosen field, profile or list to narrow queries or understand more about the information of interest. show_values() provides users with these values. search_values() allows users for search for specific values within a specified field.

Usage

show_values(df, all_fields = FALSE)

search_values(df, query)

Value

A tibble of values for a specified field, profile or list.

Arguments

df

A search result from search_fields(), search_profiles() or search_lists().

all_fields

[Experimental] If TRUE, show_values() also returns all raw data columns (columns included prior to the dataset's ingestion into the ALA). For many lists, this will include raw scientific names and vernacular names. For conservation lists like the EPBC list, this also includes columns containing each species' conservation status information. Default is set to FALSE. Currently only implemented for metadata type lists.

query

A string specifying a search term. Not case sensitive.

Details

Each Field contains categorical or numeric values. For example:

  • The field "year" contains values 2021, 2020, 2019, etc.

  • The field "stateProvince" contains values New South Wales, Victoria, Queensland, etc. These are used to narrow queries with filter() or galah_filter().

Each Profile consists of many individual quality filters. For example, the "ALA" profile consists of values:

  • Exclude all records where spatial validity is FALSE

  • Exclude all records with a latitude value of zero

  • Exclude all records with a longitude value of zero

Each List contains a list of species, usually by taxonomic name. For example, the Endangered Plant species list contains values:

  • Acacia curranii (Curly-bark Wattle)

  • Brachyscome papillosa (Mossgiel Daisy)

  • Solanum karsense (Menindee Nightshade)

Examples

Run this code
if (FALSE) {
# Show values in field 'cl22'
search_fields("cl22") |> 
  show_values()

# This is synonymous with `request_metadata() |> unnest()`.
# For example, the previous example can be run using:
request_metadata() |>
  filter(field == "cl22") |>
  unnest() |>
  collect() 

# Search for any values in field 'cl22' that match 'tas'
search_fields("cl22") |> 
  search_values("tas")

# See items within species list "dr19257"
search_lists("dr19257") |> 
  show_values()
}

Run the code above in your browser using DataLab