Learn R Programming

soql (version 0.1.1)

soql-package: \Sexpr[results=rd,stage=build]{tools:::Rd_package_title("#1")}soqlHelps Make Socrata Open Data API Calls

Description

\Sexpr[results=rd,stage=build]{tools:::Rd_package_description("#1")}soqlUsed to construct the URLs and parameters of 'Socrata Open Data API' calls, using the API's 'SoQL' parameter format. Has method-chained and sensical syntax. Plays well with pipes.

Arguments

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.

References

Documentation for the SODA API

Examples

Run this code
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)
}

Run the code above in your browser using DataLab