Learn R Programming

soql (version 0.1.1)

soql_add_endpoint: Add SODA API endpoint

Description

Add an endpoint to an already-existing soql object.

Usage

soql_add_endpoint(soql_list, endpoint)

Arguments

soql_list
The soql object. If you don't have one yet, use the soql() function first. This can be piped in.
endpoint
The endpoint should be the URL of the data, without any parameters.

Value

Returns a new soql object, with the endpoint added, for use in other functions.

References

Socrata's documentation on what an endpoint is

See Also

soql

Examples

Run this code
if (require(magrittr)) {
  # With pipes
  my_url <- soql() %>%
    soql_add_endpoint("https://fake.soda.api/resource.json") %>%
    as.character()
} else {
  # Without pipes
  soql_chain <- soql()
  soql_chain <- soql_add_endpoint(soql_chain, "https://fake.soda.api/resource.json")
  my_url <- as.character(soql_chain)
}

Run the code above in your browser using DataLab