Skip to content

Commit 920fbd7

Browse files
authored
Merge branch 'dev' into ndefries/epix-slide-pass-reftimevalue-without-env
2 parents a682557 + 5436aa3 commit 920fbd7

36 files changed

+1072
-386
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [main, master]
66
pull_request:
7-
branches: [main, master]
7+
branches: [main, master, dev]
88

99
name: R-CMD-check
1010

.github/workflows/pkgdown.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [main, master]
66
pull_request:
7-
branches: [main, master]
7+
branches: [main, master, dev]
88
release:
99
types: [published]
1010
workflow_dispatch:

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: epiprocess
33
Title: Tools for basic signal processing in epidemiology
4-
Version: 0.6.0
4+
Version: 0.6.0.9999
55
Authors@R: c(
66
person("Jacob", "Bien", role = "ctb"),
77
person("Logan", "Brooks", role = "aut"),
@@ -62,7 +62,7 @@ Config/testthat/edition: 3
6262
Encoding: UTF-8
6363
LazyData: true
6464
Roxygen: list(markdown = TRUE)
65-
RoxygenNote: 7.2.1
65+
RoxygenNote: 7.2.3
6666
Depends:
6767
R (>= 2.10)
6868
URL: https://cmu-delphi.github.io/epiprocess/

NAMESPACE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ S3method(as_epi_df,data.frame)
66
S3method(as_epi_df,epi_df)
77
S3method(as_epi_df,tbl_df)
88
S3method(as_epi_df,tbl_ts)
9+
S3method(as_tibble,epi_df)
910
S3method(as_tsibble,epi_df)
1011
S3method(dplyr_col_modify,col_modify_recorder_df)
1112
S3method(dplyr_col_modify,epi_df)
@@ -17,6 +18,7 @@ S3method(group_by,epi_archive)
1718
S3method(group_by,epi_df)
1819
S3method(group_by,grouped_epi_archive)
1920
S3method(group_by_drop_default,grouped_epi_archive)
21+
S3method(group_modify,epi_df)
2022
S3method(groups,grouped_epi_archive)
2123
S3method(next_after,Date)
2224
S3method(next_after,integer)
@@ -112,6 +114,7 @@ importFrom(rlang,sym)
112114
importFrom(rlang,syms)
113115
importFrom(stats,cor)
114116
importFrom(stats,median)
117+
importFrom(tibble,as_tibble)
115118
importFrom(tidyr,unnest)
116119
importFrom(tidyselect,eval_select)
117120
importFrom(tidyselect,starts_with)

NEWS.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,33 @@ inter-release development versions will include an additional ".9999" suffix.
1616

1717
## New features:
1818

19+
* `epix_slide` has been made more like `dplyr::group_modify`. It will no longer
20+
perform element/row recycling for size stability, accepts slide computation
21+
outputs containing any number of rows, and no longer supports `all_rows`.
22+
* To keep the old behavior, manually perform row recycling within `f`
23+
computations, and/or `left_join` a data frame representing the desired
24+
output structure with the current `epix_slide()` result to obtain the
25+
desired repetitions and completions expected with `all_rows = TRUE`.
26+
* `epix_slide` will only output grouped or ungrouped tibbles. Previously, it
27+
would sometimes output `epi_df`s, but not consistently, and not always with
28+
the metadata desired. Future versions will revisit this design, and consider
29+
more closely whether/when/how to output an `epi_df`.
30+
* To keep the old behavior, convert the output of `epix_slide()` to `epi_df`
31+
when desired and set the metadata appropriately.
1932
* `epix_slide` `f` computations passed as functions or formulas now have
2033
access to the reference time value. If `f` is a function, it is passed a
2134
Date containing the reference time value as the third argument. If a
2235
formula, `f` can access the reference time value via `.z` or
2336
`.ref_time_value`.
2437

38+
## Improvements:
39+
40+
* `epi_slide` and `epix_slide` now support `as_list_col = TRUE` when the slide
41+
computations output atomic vectors, and output a list column in "chopped"
42+
format (see `tidyr::chop`).
43+
* `epi_slide` now works properly with slide computations that output just a
44+
`Date` vector, rather than converting `slide_value` to a numeric column.
45+
2546
# epiprocess 0.6.0
2647

2748
## Breaking changes:
@@ -41,6 +62,13 @@ inter-release development versions will include an additional ".9999" suffix.
4162
* Slide functions now keep any grouping of `x` in their results, like
4263
`mutate` and `group_modify`.
4364
* To obtain the old behavior, `dplyr::ungroup` the slide results immediately.
65+
* Additional `epi_slide` changes:
66+
* When using `as_list_col = TRUE` together with `ref_time_values` and
67+
`all_rows=TRUE`, the marker for excluded computations is now a `NULL` entry
68+
in the list column, rather than a `NA`; if you are using `tidyr::unnest()`
69+
afterward and want to keep these missing data markers, you will need to
70+
replace the `NULL` entries with `NA`s. Skipped computations are now more
71+
uniformly detectable using `vctrs` methods.
4472
* Additional`epix_slide` changes:
4573
* `epix_slide`'s `group_by` argument has been replaced by `dplyr::group_by` and
4674
`dplyr::ungroup` S3 methods. The `group_by` method uses "data masking" (also

R/archive.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ epi_archive =
307307
Abort("compactify must be boolean or null.")
308308
}
309309

310-
# Apply defaults and conduct checks and apply defaults for
310+
# Apply defaults and conduct checks for
311311
# `clobberable_versions_start`, `versions_end`:
312312
if (missing(clobberable_versions_start)) {
313313
clobberable_versions_start <- NA
@@ -640,7 +640,7 @@ epi_archive =
640640
slide = function(f, ..., before, ref_time_values,
641641
time_step, new_col_name = "slide_value",
642642
as_list_col = FALSE, names_sep = "_",
643-
all_rows = FALSE, all_versions = FALSE) {
643+
all_versions = FALSE) {
644644
# For an "ungrouped" slide, treat all rows as belonging to one big
645645
# group (group by 0 vars), like `dplyr::summarize`, and let the
646646
# resulting `grouped_epi_archive` handle the slide:
@@ -649,7 +649,7 @@ epi_archive =
649649
before = before, ref_time_values = ref_time_values,
650650
time_step = time_step, new_col_name = new_col_name,
651651
as_list_col = as_list_col, names_sep = names_sep,
652-
all_rows = all_rows, all_versions = all_versions
652+
all_versions = all_versions
653653
) %>%
654654
# We want a slide on ungrouped archives to output something
655655
# ungrouped, rather than retaining the trivial (0-variable)

0 commit comments

Comments
 (0)