View source: R/dplyr-collapse.R
| collapse.data_request | R Documentation |
Constructs a query so it can be inspected before being sent. collapse() can
be called at the end of a pipe that begins with galah_call() to return the
constructed user query generated by the user's data request
(a query object). Objects
of class data_request (created using request_data()), metadata_request
(from request_metadata()) or files_request (from request_files()) are
all supported.
## S3 method for class 'data_request'
collapse(x, ...)
## S3 method for class 'metadata_request'
collapse(x, ...)
## S3 method for class 'files_request'
collapse(x, ...)
## S3 method for class 'prequery'
collapse(x, ...)
## S3 method for class 'query'
collapse(x, ...)
## S3 method for class 'query_set'
collapse(x, ...)
x |
An object to run |
... |
Arguments passed on to |
galah uses an object-based pipeline to convert piped requests into
valid queries, and to enact those queries with the specified organisation.
Typically, requests open with galah_call() - though request_metadata()
and request_files() are also valid - and end with
collect(). Under the hood,
the sequence of functions is as follows:
capture() → compound() →
collapse() →
compute() →
collect()
collapse() constructs a complete
user query, ready to be sent by
compute().
Information required to construct a complete user query are
provided by capture() and compound(), preceding functions to
parse and combine all required API calls necessary to build a user's query.
An object of class query, which is a list-like object containing
two or more of the following slots:
type: The type of query, serves as a lookup to the corresponding field in show_all(apis)
url: Either:
a length-1 character giving the API to be queried; or
a tibble containing at least the field url and optionally others
headers: headers to be sent with the API call
body: body section of the API call
options: options section of the API call
request: captures the supplied _request object (see galah_call())
To open a piped query, see galah_call(). For alternative
operations on _request objects, see capture(), compound(),
compute() or
collect().
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.