Computes the percentage change of the values in a covidcast_signal
data
frame. (When multiple issue dates are present, only the latest issue is
considered.) See the percentage change vignette
for examples.
pct_change(x, n = 14, col_name = "pct_change")
x | The |
---|---|
n | Size of the local window (in days) to use (bumped up to the nearest
even integer, if needed). For example, if |
col_name | String indicating the name of the new column that will
contain the percentage change values. Default is "pct_change"; note that we
can set |
A data frame given by appending a new column to x
named according
to the col_name
argument, containing the percentage change values.