Learn R Programming

galah (version 2.1.1)

tidyverse_functions: Non-generic tidyverse functions

Description

Several useful functions from tidyverse packages are generic, meaning that we can define class-specific versions of those functions and implement them in galah; examples include filter(), select() and group_by(). However, there are also functions that are only defined within tidyverse packages and are not generic. In a few cases we have re-implemented these functions in galah. This has the consequence of supporting consistent syntax with tidyverse, at the cost of potentially introducing conflicts. This can be avoided by using the :: operator where required (see examples).

Usage

desc(...)

unnest(.query)

Value

  • galah::desc() returns a tibble used by arrange.data_request() to arrange rows of a query.

  • galah::unnest() returns an object of class metadata_request.

Arguments

...

column to order by

.query

An object of class metadata_request

Details

The following functions are included:

  • desc() (dplyr): Use within arrange() to specify arrangement should be descending

  • unnest() (tidyr): Use to 'drill down' into nested information on fields, lists, profiles, or taxa

These galah versions all use lazy evaluation.

See Also

arrange(), galah_call()

Examples

Run this code
if (FALSE) {
# Arrange grouped record counts by descending year
galah_call() |>
  identify("perameles") |>
  filter(year > 2019) |>
  count() |>
  arrange(galah::desc(year)) |>
  collect()

# Return values of field `basisOfRecord`
request_metadata() |> 
  galah::unnest() |> 
  filter(field == basisOfRecord) |> 
  collect()
  
# Using `galah::unnest()` in this way is equivalent to:
show_all(fields, "basisOfRecord") |> 
  show_values()
}

Run the code above in your browser using DataLab