Skip to contents

As of version 2.0, galah supports several bespoke object types. Classes data_request, metadata_request and files_request are for starting pipes to download different types of information. These objects are parsed using collapse() into a query object, which contains one or more URLs necessary to return the requested information. This object is then passed to compute() and/or collect(). Finally, galah_config() creates an object of class galah_config which (unsurprisingly) stores configuration information.

Usage

# S3 method for data_request
print(x, ...)

# S3 method for files_request
print(x, ...)

# S3 method for metadata_request
print(x, ...)

# S3 method for query
print(x, ...)

# S3 method for computed_query
print(x, ...)

# S3 method for query_set
print(x, ...)

# S3 method for galah_config
print(x, ...)

Arguments

x

an object of the appropriate class

...

Arguments to be passed to or from other methods

Value

Print does not return an object; instead it prints a description of the object to the console

Examples

# The most common way to start a pipe is with `galah_call()`
# later functions update the `data_request` object
galah_call() |> # same as calling `request_data()`
  filter(year >= 2020) |>
  group_by(year) |>
  count()
#> Object of type `data_request` containing:
#>  type occurrences-count
#>  filter year >= 2020
#>  group_by year

# Metadata requests are formatted in a similar way
request_metadata() |>
  filter(field == basisOfRecord) |>
  unnest()
#> Object of type `metadata_request` containing:
#>  type fields-unnest
#>  filter field == basisOfRecord

# Queries are converted into a `query_set` by `collapse()`
x <- galah_call() |> # same as calling `request_data()`
  filter(year >= 2020) |>
  count() |>
  collapse()
print(x)
#> Object of class query with type data/occurrences-count 
#> url: https://biocache-ws.ala.org.au/ws/occurrences/search?fq=%28year%3A%5B2...  
  
# Each `query_set` contains one or more `query` objects
x[[3]]
#> [1] "totalRecords"