Skip to contents

Construct a Socrata open data API (SODA) query for the NSHN dataset

Usage

nhsn_soda_query(
  api_endpoint,
  start_date = NULL,
  end_date = NULL,
  columns = NULL,
  states = NULL,
  limit = 1e+05,
  order_by = c("state", "date"),
  desc = FALSE,
  ...
)

Arguments

api_endpoint

Base API endpoint URL to use when constructing the query.

start_date

Pull only rows with dates greater than or equal to this date. If NULL, no minimum date. Default NULL.

end_date

Pull only rows with dates less than or equal to this date. If NULL, no maximum date. Default NULL.

columns

Vector of columns to retrieve, in addition to date and state, which are always retrieved. If NULL, retrieve all columns. Default NULL.

states

Vector of states or territories to retrieve, by two letter US postal service code. If NULL, retrieve all. Default NULL.

limit

limit to the number of rows to retrieve. Default 1e5.

order_by

Vector of columns by which to order the results. Default c("state", "date")

desc

whether to order descending instead of ascending. Default FALSE (order ascending).

...

additional arguments (ignored for now)

Value

the query as soql::soql() output