as.covidcast_signal | R Documentation |
covidcast_signal
.Several methods are provided to convert common objects (such as data frames)
into covidcast_signal
objects, which can be used with the various
covidcast_signal
methods (such as plot.covidcast_signal()
or
covidcast_cor()
). See vignette("external-data")
for examples.
as.covidcast_signal(x, ...)
## S3 method for class 'covidcast_signal'
as.covidcast_signal(x, ...)
## S3 method for class 'data.frame'
as.covidcast_signal(
x,
signal = NULL,
geo_type = c("county", "msa", "hrr", "dma", "state", "hhs", "nation"),
time_type = c("day", "week"),
data_source = "user",
issue = NULL,
metadata = list(),
...
)
x |
Object to be converted. See Methods section below for details on formatting of each input type. |
... |
Additional arguments passed to methods. |
signal |
The signal name to use for this data. |
geo_type |
The geography type stored in this object. |
time_type |
The time resolution stored in this object. If "day", the default, each observation covers one day. If "week", each time value is assumed to be the start date of the epiweek (MMWR week) that the data represents. |
data_source |
The name of the data source to use as a label for this data. |
issue |
Issue date to use for this data, if not present in |
metadata |
List of metadata to attach to the |
covidcast_signal
object; see covidcast_signal()
for documentation
of fields and structure.
as.covidcast_signal(covidcast_signal)
: Simply returns the covidcast_signal
object
unchanged.
as.covidcast_signal(data.frame)
: The input data frame x
must contain the
columns time_value
, value
, and geo_value
. If an issue
column is
present in x
, it will be used as the issue date for each observation; if
not, the issue
argument will be used. Other columns will be preserved
as-is.
covidcast_signal()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.