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).
Value
galah::desc()
returns atibble
used byarrange.data_request()
to arrange rows of a query.galah::unnest()
returns an object of classmetadata_request
.
Details
The following functions are included:
desc()
(dplyr
): Use withinarrange()
to specify arrangement should be descendingunnest()
(tidyr
): Use to 'drill down' into nested information onfields
,lists
,profiles
, ortaxa
These galah versions all use lazy evaluation.
Examples
if (FALSE) { # \dontrun{
# 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()
} # }