soql_add_endpoint: Add SODA API endpoint

Description Usage Arguments Value References See Also Examples

View source: R/soql.R

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)
}

Example output

Loading required package: magrittr

soql documentation built on May 2, 2019, 8:50 a.m.