covidcast_signals | R Documentation |
This convenience function uses covidcast_signal()
to obtain multiple
signals, potentially from multiple data sources.
covidcast_signals(
data_source,
signal,
start_day = NULL,
end_day = NULL,
geo_type = c("county", "hrr", "msa", "dma", "state", "hhs", "nation"),
time_type = c("day", "week"),
geo_values = "*",
as_of = NULL,
issues = NULL,
lag = NULL
)
data_source |
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. |
signal |
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. |
start_day |
Query data beginning on this date. Date object, or string in
the form "YYYY-MM-DD". If |
end_day |
Query data up to this date, inclusive. Date object or string
in the form "YYYY-MM-DD". If |
geo_type |
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. |
time_type |
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"). |
geo_values |
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. |
as_of |
Fetch only data that was available on or before this date,
provided as a |
issues |
Fetch only data that was published or updated ("issued") on
these dates. Provided as either a single |
lag |
Integer. If, for example, |
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.
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()
.
covidcast_signal()
, aggregate_signals()
## Not run:
## 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")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.