This convenience function uses covidcast_signal()
to obtain multiple
signals, potentially from multiple data sources.
String identifying the data source to query. See https://cmu-delphi.github.io/delphi-epidata/api/covidcast_signals.html for a list of available data sources.
String identifying the signal from that source to query. Again, see https://cmu-delphi.github.io/delphi-epidata/api/covidcast_signals.html for a list of available signals.
Query data beginning on this date. Date object, or string in
the form "YYYY-MM-DD". If start_day
is NULL
, defaults to first day data
is available for this signal.
Query data up to this date, inclusive. Date object or string
in the form "YYYY-MM-DD". If end_day
is NULL
, defaults to the most
recent day data is available for this signal.
The geography type for which to request this data, such as "county" or "state". Defaults to "county". See https://cmu-delphi.github.io/delphi-epidata/api/covidcast_geography.html for details on which types are available.
The temporal resolution to request this data. Most signals are available at the "day" resolution (the default); some are only available at the "week" resolution, representing an MMWR week ("epiweek").
Which geographies to return. The default, "*", fetches all geographies. To fetch specific geographies, specify their IDs as a vector or list of strings. See https://cmu-delphi.github.io/delphi-epidata/api/covidcast_geography.html for details on how to specify these IDs.
Fetch only data that was available on or before this date,
provided as a Date
object or string in the form "YYYY-MM-DD". If NULL
,
the default, return the most recent available data. Note that only one of
as_of
, issues
, and lag
should be provided; it does not make sense to
specify more than one. For more on data revisions, see
"Issue dates and revisions" below.
Fetch only data that was published or updated ("issued") on
these dates. Provided as either a single Date
object (or string in the
form "YYYY-MM-DD"), indicating a single date to fetch data issued on, or a
vector specifying two dates, start and end. In this case, return all data
issued in this range. There may be multiple rows for each observation,
indicating several updates to its value. If NULL
, the default, return the
most recently issued data.
Integer. If, for example, lag = 3
, then we fetch only data that
was published or updated exactly 3 days after the date. For example, a row
with time_value
of June 3 will only be included in the results if its
data was issued or updated on June 6. If NULL
, the default, return the
most recently issued data regardless of its lag.
A list of covidcast_signal
data frames, of length N = max(length(data_source), length(signal))
. This list can be aggregated
into a single data frame of either "wide" or "long" format using
aggregate_signals()
.
The argument structure is just as in covidcast_signal()
, except
the first four arguments data_source
, signal
, start_day
, end_day
are permitted to be vectors. The first two arguments data_source
and
signal
are recycled appropriately in the calls to covidcast_signal()
;
see example below. The next two arguments start_day
, end_day
, unless
NULL
, must be either length 1 or N.
See vignette("multi-signals")
for additional examples.
if (FALSE) {
## Fetch USAFacts confirmed cases and deaths over the same time period
covidcast_signals("usa-facts", signal = c("confirmed_incidence_num",
"deaths_incidence_num"),
start_day = "2020-08-15", end_day = "2020-10-01")
}