soql_add_endpoint: Add SODA API endpoint

Description

Add an endpoint to an already-existing soql object.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)
}

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.