soql-package {soql} | R Documentation |
Helps Make Socrata Open Data API Calls
Description
Used to construct the URLs and parameters of 'Socrata Open Data API' <https://dev.socrata.com> calls, using the API's 'SoQL' parameter format. Has method-chained and sensical syntax. Plays well with pipes.
Details
To create a SoQL URL, or just parameters for one, start with soql()
. Then chain the result into other functions, such as soql_where()
or soql_order()
. When you're done, use as.character()
to retrieve the finished URL, for use with any networking package.
Author(s)
Zeb Burke-Conte
Maintainer: "Zeb Burke-Conte" <zmbc@uw.edu>
References
Documentation for the SODA API
Examples
if (require(magrittr)) {
# With pipes
my_url <- soql() %>%
soql_where("height > 30") %>%
soql_limit(20) %>%
as.character()
} else {
# Without pipes
soql_chain <- soql()
soql_chain <- soql_where(soql_chain, "height > 30")
soql_chain <- soql_limit(20)
my_url <- as.character(soql_chain)
}
[Package soql version 0.1.1 Index]