Breaking changes:
- Changes to
epi_slide
andepix_slide
:- If
f
is a function, it is now required to take at least three arguments.
f
must take anepi_df
with the same column names as the archive'sDT
,
minus theversion
column; followed by a one-row tibble containing the
values of the grouping variables for the associated group; followed by a
reference time value, usually as aDate
object. Optionally, it can take
any number of additional arguments after that, and forward values for those
arguments throughepi[x]_slide
's...
args.- To make your existing slide computations work, add a third argument to
yourf
function to accept this new input: e.g., changef = function(x, g, <any other arguments>) { <body> }
tof = function(x, g, rt, <any other arguments>) { <body> }
.
- To make your existing slide computations work, add a third argument to
- If
New features:
epi_slide
andepix_slide
also make the window data, group key and
reference time value available to slide computations specified as formulas or
tidy evaluation expressions, in additional or completely new ways.- If
f
is a formula, it can now access the reference time value via.z
or
.ref_time_value
. - If
f
is missing, the tidy evaluation expression in...
can now refer to
the window data as anepi_df
ortibble
with.x
, the group key with
.group_key
, and the reference time value with.ref_time_value
. The usual
.data
and.env
pronouns also work, butpick()
andcur_data()
are not;
work off of.x
instead.
- If
epix_slide
has been made more likedplyr::group_modify
. It will no longer
perform element/row recycling for size stability, accepts slide computation
outputs containing any number of rows, and no longer supportsall_rows
.- To keep the old behavior, manually perform row recycling within
f
computations, and/orleft_join
a data frame representing the desired
output structure with the currentepix_slide()
result to obtain the
desired repetitions and completions expected withall_rows = TRUE
.
- To keep the old behavior, manually perform row recycling within
epix_slide
will only output grouped or ungrouped tibbles. Previously, it
would sometimes outputepi_df
s, but not consistently, and not always with
the metadata desired. Future versions will revisit this design, and consider
more closely whether/when/how to output anepi_df
.- To keep the old behavior, convert the output of
epix_slide()
toepi_df
when desired and set the metadata appropriately.
- To keep the old behavior, convert the output of
Improvements:
epi_slide
andepix_slide
now supportas_list_col = TRUE
when the slide
computations output atomic vectors, and output a list column in "chopped"
format (seetidyr::chop
).epi_slide
now works properly with slide computations that output just a
Date
vector, rather than convertingslide_value
to a numeric column.- Fix
?archive_cases_dv_subset
information regarding modifications of upstream
data by @brookslogan in (#299). - Update to use updated
epidatr
(fetch_tbl
->fetch
) by @brookslogan in
(#319).
New Contributors
Full Changelog: v0.6.0...v0.7.0