epiprocess 0.6.0
Breaking changes
- Changes to both
epi_slide
andepix_slide
- The
n
,align
, andbefore
arguments have been replaced by new
before
andafter
arguments. To migrate to the new version, replace
these arguments in everyepi_slide
andepix_slide
call. If you were
only using then
argument, then this means replacingn = <n value>
withbefore = <n value> - 1
. epi_slide
's time windows now extendbefore
time steps before and
after
time steps after the correspondingref_time_values
. See
?epi_slide
for details on matching old alignments.epix_slide
's time windows now extendbefore
time steps before the
correspondingref_time_values
all the way through the latest data
available at the correspondingref_time_values
.- Slide functions now keep any grouping of
x
in their results, like
mutate
andgroup_modify
.- To obtain the old behavior,
dplyr::ungroup
the slide results immediately.
- To obtain the old behavior,
- The
- Additional
epi_slide
changes:- When using
as_list_col = TRUE
together withref_time_values
and
all_rows=TRUE
, the marker for excluded computations is now aNULL
entry
in the list column, rather than aNA
; if you are usingtidyr::unnest()
afterward and want to keep these missing data markers, you will need to
replace theNULL
entries withNA
s. Skipped computations are now more
uniformly detectable usingvctrs
methods.
- When using
- Additional
epix_slide
changes:epix_slide
'sgroup_by
argument has been replaced bydplyr::group_by
and
dplyr::ungroup
S3 methods. Thegroup_by
method uses "data masking" (also
referred to as "tidy evaluation") rather than "tidy selection".- Old syntax:
x %>% epix_slide(<other args>, group_by=c(col1, col2))
x %>% epix_slide(<other args>, group_by=all_of(colname_vector))
- New syntax:
x %>% group_by(col1, col2) %>% epix_slide(<other args>)
x %>% group_by(across(all_of(colname_vector))) %>% epix_slide(<other args>)
- Old syntax:
epix_slide
no longer defaults to grouping by non-time_value
, non-version
key columns, instead considering all data to be in one big group.- To obtain the old behavior, precede each
epix_slide
call lacking a
group_by
argument with an appropriategroup_by
call.
- To obtain the old behavior, precede each
epix_slide
now guessesref_time_values
to be a regularly spaced sequence
covering all theDT$version
values and theversion_end
, rather than the
distinctDT$time_value
s. To obtain the old behavior, pass in
ref_time_values = unique(<ungrouped archive>$DT$time_value)
.
epi_archive
'sclobberable_versions_start
's default is nowNA
, so there
will be no warnings by default about potential nonreproducibility. To obtain
the old behavior, pass inclobberable_versions_start = max_version_with_row_in(x)
.
Potentially-breaking changes
- Fixed
[
on groupedepi_df
s to maintain the grouping if possible when
dropping theepi_df
class (e.g., when removing thetime_value
column). - Fixed
epi_df
operations to be more consistent about decaying into
non-epi_df
s when the result of the operation doesn't make sense as an
epi_df
(e.g., when removing thetime_value
column). - Changed
bind_rows
on groupedepi_df
s to not drop theepi_df
class. Like
with ungroupedepi_df
s, the metadata of the result is still simply taken
from the first result, and may be inappropriate
(#242). epi_slide
andepix_slide
now raise an error rather than silently filtering
outref_time_values
that don't meet their expectations.
New features
epix_slide
,<epi_archive>$slide
have a new parameterall_versions
. With
all_versions=TRUE
,epix_slide
will pass a filteredepi_archive
to each
computation rather than anepi_df
snapshot. This enables, e.g., performing
pseudoprospective forecasts with a revision-aware forecaster using nested
epix_slide
operations.
Improvements
- Added
dplyr::group_by
anddplyr::ungroup
S3 methods forepi_archive
objects, plus corresponding$group_by
and$ungroup
R6 methods. The
group_by
implementation supports the.add
and.drop
arguments, and
ungroup
supports partial ungrouping with...
. as_epi_archive
,epi_archive$new
now perform checks for the key uniqueness
requirement (part of
#154).
Cleanup
- Added a
NEWS.md
file to track changes to the package. - Implemented
?dplyr::dplyr_extending
forepi_df
s
(#223). - Fixed various small documentation issues (#217).
Full Changelog: https://github.com/cmu-delphi/epiprocess/commits/v0.6.0