Helper function for common Socrata open data API (SODA) queries targeted at data.cdc.gov
datasets.
Source: R/pull_data_cdc_gov.R
data_cdc_gov_soda_query.Rd
Helper function for common Socrata open data
API (SODA) queries targeted at data.cdc.gov
datasets.
Usage
data_cdc_gov_soda_query(
dataset_id,
date_col = NULL,
location_col = NULL,
start_date = NULL,
end_date = NULL,
columns = NULL,
locations = NULL,
limit = 1e+05,
order_by = NULL,
desc = FALSE,
...
)
Arguments
- dataset_id
Dataset ID for the dataset
- date_col
Name of the date column for the dataset, if any. Default
NULL
.- location_col
Name of the location column for the dataset, if any. Default
NULL
.- start_date
Pull only rows with dates greater than or equal to this date. If
NULL
, no minimum date. DefaultNULL
.- end_date
Pull only rows with dates less than or equal to this date. If
NULL
, no maximum date. DefaultNULL
.- columns
Vector of columns to retrieve, in addition to the dataset's date and location columns, which are always retrieved. If
NULL
, retrieve all columns. DefaultNULL
.- locations
Vector of locations to retrieve, in the format of the dataset's location column. If
NULL
, retrieve all. DefaultNULL
.- limit
limit to the number of rows to retrieve. Default 1e5.
- order_by
Vector of columns by which to order the results, if any. If
NULL
(default), order first by the date column, then by the location column. Having a default ordering makes queries more robust against unpredictable results.- desc
whether to order descending instead of ascending. Default
FALSE
(order ascending).- ...
additional arguments (ignored for now)
Value
the query as soql::soql()
output