Skip to content

epiprocess 0.7.0

Latest
Compare
Choose a tag to compare
@dshemetov dshemetov released this 30 Nov 20:54
· 868 commits to main since this release
e7a4dfa

Breaking changes:

  • Changes to epi_slide and epix_slide:
    • If f is a function, it is now required to take at least three arguments.
      f must take an epi_df with the same column names as the archive's DT,
      minus the version 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 a Date object. Optionally, it can take
      any number of additional arguments after that, and forward values for those
      arguments through epi[x]_slide's ... args.
      • To make your existing slide computations work, add a third argument to
        your f function to accept this new input: e.g., change f = function(x, g, <any other arguments>) { <body> } to f = function(x, g, rt, <any other arguments>) { <body> }.

New features:

  • epi_slide and epix_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 an epi_df or tibble 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() and cur_data() are not;
      work off of .x instead.
  • epix_slide has been made more like dplyr::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 supports all_rows.
    • To keep the old behavior, manually perform row recycling within f
      computations, and/or left_join a data frame representing the desired
      output structure with the current epix_slide() result to obtain the
      desired repetitions and completions expected with all_rows = TRUE.
  • epix_slide will only output grouped or ungrouped tibbles. Previously, it
    would sometimes output epi_dfs, 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 an epi_df.
    • To keep the old behavior, convert the output of epix_slide() to epi_df
      when desired and set the metadata appropriately.

Improvements:

  • epi_slide and epix_slide now support as_list_col = TRUE when the slide
    computations output atomic vectors, and output a list column in "chopped"
    format (see tidyr::chop).
  • epi_slide now works properly with slide computations that output just a
    Date vector, rather than converting slide_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