Skip to content

Commit 44e7095

Browse files
authored
Merge pull request #477 from cmu-delphi/lcb/slide-improvements-2024-06
Slide improvements pass
2 parents 8dff011 + 187bd5d commit 44e7095

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+4234
-3806
lines changed

.Rbuildignore

+2
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@
1616
^.lintr$
1717
^DEVELOPMENT.md$
1818
man-roxygen
19+
^.venv$
20+
^sandbox.R$

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ docs
1313
renv/
1414
renv.lock
1515
.Rprofile
16+
sandbox.R

DESCRIPTION

+23-17
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Type: Package
22
Package: epiprocess
33
Title: Tools for basic signal processing in epidemiology
4-
Version: 0.8.4
4+
Version: 0.9.0
55
Authors@R: c(
66
person("Jacob", "Bien", role = "ctb"),
7-
person("Logan", "Brooks", email = "[email protected]", role = c("aut", "cre")),
7+
person("Logan", "Brooks", , "[email protected]", role = c("aut", "cre")),
88
person("Rafael", "Catoia", role = "ctb"),
99
person("Nat", "DeFries", role = "ctb"),
1010
person("Daniel", "McDonald", role = "aut"),
@@ -15,23 +15,28 @@ Authors@R: c(
1515
person("Evan", "Ray", role = "aut"),
1616
person("Dmitry", "Shemetov", role = "ctb"),
1717
person("Ryan", "Tibshirani", role = "aut"),
18-
person("Lionel", "Henry", role = "ctb", comment = "Author of included rlang fragments"),
19-
person("Hadley", "Wickham", role = "ctb", comment = "Author of included rlang fragments"),
20-
person("Posit", role = "cph", comment = "Copyright holder of included rlang fragments")
18+
person("Lionel", "Henry", role = "ctb",
19+
comment = "Author of included rlang fragments"),
20+
person("Hadley", "Wickham", role = "ctb",
21+
comment = "Author of included rlang fragments"),
22+
person("Posit", role = "cph",
23+
comment = "Copyright holder of included rlang fragments")
2124
)
22-
Description: This package introduces a common data structure for epidemiological
23-
data reported by location and time, provides another data structure to
24-
work with revisions to these data sets over time, and offers associated
25-
utilities to perform basic signal processing tasks.
25+
Description: This package introduces a common data structure for
26+
epidemiological data reported by location and time, provides another
27+
data structure to work with revisions to these data sets over time,
28+
and offers associated utilities to perform basic signal processing
29+
tasks.
2630
License: MIT + file LICENSE
27-
Copyright: file inst/COPYRIGHTS
31+
URL: https://cmu-delphi.github.io/epiprocess/
32+
Depends:
33+
R (>= 3.6)
2834
Imports:
2935
checkmate,
3036
cli,
3137
data.table,
3238
dplyr (>= 1.0.8),
3339
genlasso,
34-
glue,
3540
ggplot2,
3641
glue,
3742
lifecycle (>= 1.0.1),
@@ -45,7 +50,8 @@ Imports:
4550
tidyselect (>= 1.2.0),
4651
tsibble,
4752
utils,
48-
vctrs
53+
vctrs,
54+
waldo
4955
Suggests:
5056
covidcast,
5157
devtools,
@@ -59,22 +65,22 @@ VignetteBuilder:
5965
knitr
6066
Remotes:
6167
cmu-delphi/epidatr,
62-
reconverse/outbreaks,
63-
glmgen/genlasso
68+
glmgen/genlasso,
69+
reconverse/outbreaks
6470
Config/testthat/edition: 3
71+
Config/testthat/parallel: true
72+
Copyright: file inst/COPYRIGHTS
6573
Encoding: UTF-8
6674
LazyData: true
6775
Roxygen: list(markdown = TRUE)
6876
RoxygenNote: 7.3.2
69-
Depends:
70-
R (>= 2.10)
71-
URL: https://cmu-delphi.github.io/epiprocess/
7277
Collate:
7378
'archive.R'
7479
'autoplot.R'
7580
'correlation.R'
7681
'data.R'
7782
'epi_df.R'
83+
'epi_df_forbidden_methods.R'
7884
'epiprocess.R'
7985
'group_by_epi_df_methods.R'
8086
'methods-epi_archive.R'

NAMESPACE

+10
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22

33
S3method("[",epi_df)
44
S3method("names<-",epi_df)
5+
S3method(Summary,epi_df)
56
S3method(arrange_canonical,default)
67
S3method(arrange_canonical,epi_df)
8+
S3method(arrange_col_canonical,default)
9+
S3method(arrange_col_canonical,epi_df)
10+
S3method(arrange_row_canonical,default)
11+
S3method(arrange_row_canonical,epi_df)
712
S3method(as_epi_df,data.frame)
813
S3method(as_epi_df,epi_df)
914
S3method(as_epi_df,tbl_df)
@@ -27,6 +32,7 @@ S3method(group_by,epi_df)
2732
S3method(group_by,grouped_epi_archive)
2833
S3method(group_by_drop_default,grouped_epi_archive)
2934
S3method(group_modify,epi_df)
35+
S3method(group_vars,grouped_epi_archive)
3036
S3method(groups,grouped_epi_archive)
3137
S3method(guess_period,Date)
3238
S3method(guess_period,POSIXt)
@@ -35,6 +41,7 @@ S3method(key_colnames,data.frame)
3541
S3method(key_colnames,default)
3642
S3method(key_colnames,epi_archive)
3743
S3method(key_colnames,epi_df)
44+
S3method(mean,epi_df)
3845
S3method(next_after,Date)
3946
S3method(next_after,integer)
4047
S3method(print,epi_archive)
@@ -71,6 +78,7 @@ export(filter)
7178
export(full_seq)
7279
export(geo_column_names)
7380
export(group_by)
81+
export(group_epi_df)
7482
export(group_modify)
7583
export(growth_rate)
7684
export(guess_period)
@@ -86,6 +94,7 @@ export(relocate)
8694
export(rename)
8795
export(revision_summary)
8896
export(slice)
97+
export(sum_groups_epi_df)
8998
export(time_column_names)
9099
export(ungroup)
91100
export(unnest)
@@ -145,6 +154,7 @@ importFrom(dplyr,everything)
145154
importFrom(dplyr,filter)
146155
importFrom(dplyr,group_by)
147156
importFrom(dplyr,group_by_drop_default)
157+
importFrom(dplyr,group_map)
148158
importFrom(dplyr,group_modify)
149159
importFrom(dplyr,group_vars)
150160
importFrom(dplyr,groups)

NEWS.md

+58-12
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,54 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.x.y will indicat
44

55
# epiprocess 0.9
66

7+
## Breaking changes
8+
9+
- `epi_slide` interface has major breaking changes.
10+
- All variables are now dot-prefixed to be more consistent with tidyverse
11+
style for functions that allow tidyeval.
12+
- The `before/after` arguments have been replaced with the `.window_size` and
13+
`.align` arguments.
14+
- `names_sep` has been removed. If you return data frames from your
15+
computations:
16+
- without a name, they will be unpacked into separate columns without name
17+
prefixes
18+
- with a name, it will become a packed data.frame-class column (see
19+
`tidyr::pack`).
20+
- `as_list_col` has been removed. You can now directly return a list from your
21+
slide computations instead. If you were using `as_list_col=TRUE`, you will
22+
need to wrap your output in a list.
23+
- Ungrouped slides are no longer allowed in `epi_slide`. If you used this for
24+
geographic aggregation up to national, consider using `sum_groups_epi_df`.
25+
- Added `sum_groups_epi_df` to allow aggregation across key columns prior to
26+
sliding.
27+
- `epix_slide` interface has major changes.
28+
- All variables are now dot-prefixed to be more consistent with tidyverse
29+
style for functions that allow tidyeval.
30+
- `names_sep` has been removed. If you return data frames from your
31+
computations:
32+
- without a name, they will be unpacked into separate columns without name
33+
prefixes
34+
- with a name, it will become a packed data.frame-class column (see
35+
`tidyr::pack`).
36+
- `as_list_col` has been removed. You can now directly return a list from your
37+
slide computations instead. If you were using `as_list_col=TRUE`, you will
38+
need to wrap your output in a list.
39+
- `as_epi_df()` now checks that every group has unique time values and errors if
40+
this is not the case. The same check is performed at the beginning of
41+
`epi_slide()`. This check is currently not enforced in dplyr operations (like
42+
for joins, mutates, or select), but we plan to add it in the future.
43+
- `as_epi_df()` or `as_epi_archive()` no longer accept `additional_metadata`.
44+
Use the new `other_keys` arg to specify additional key columns, such as age
45+
group columns or other demographic breakdowns. Miscellaneous metadata are no
46+
longer handled by `epiprocess`, but you can use R's built-in `attr<-` instead
47+
for a similar feature.
48+
749
## Improvements
850

951
- Added `complete.epi_df`, which fills in missing values in an `epi_df` with
1052
`NA`s. Uses `tidyr::complete` underneath and preserves `epi_df` metadata.
11-
- Inclusion of the function `revision_summary` to provide basic revision information for `epi_archive`s out of the box. (#492)
53+
- Inclusion of the function `revision_summary` to provide basic revision
54+
information for `epi_archive`s out of the box. (#492)
1255

1356
## Bug fixes
1457

@@ -21,6 +64,14 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.x.y will indicat
2164

2265
## Breaking changes
2366

67+
- `epi_df`'s are now more strict about what types they allow in the time column.
68+
Namely, we are explicit about only supporting `Date` at the daily and weekly
69+
cadence and generic integer types (for yearly cadence).
70+
- `epi_slide` `before` and `after` arguments are now require the user to
71+
specific time units in certain cases. The `time_step` argument has been
72+
removed.
73+
- `epix_slide` `before` argument now defaults to `Inf`, and requires the user to
74+
specify units in some cases. The `time_step` argument has been removed.
2475
- `detect_outlr_stl(seasonal_period = NULL)` is no longer accepted. Use
2576
`detect_outlr_stl(seasonal_period = <value>, seasonal_as_residual = TRUE)`
2677
instead. See `?detect_outlr_stl` for more details.
@@ -63,6 +114,12 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.x.y will indicat
63114
are similar functions for `geo` and `version`).
64115
- Fixed bug where `epix_slide_ref_time_values_default()` on datetimes would
65116
output a huge number of `ref_time_values` spaced apart by mere seconds.
117+
- In `epi_slide()` and `epix_slide()`:
118+
- Multiple "data-masking" tidy evaluation expressions can be passed in via
119+
`...`, rather than just one.
120+
- Additional tidy evaluation features from `dplyr::mutate` are supported: `!!
121+
name_var := value`, unnamed expressions evaluating to data frames, and `=
122+
NULL`; see `?epi_slide` for more details.
66123

67124
## Cleanup
68125

@@ -71,17 +128,6 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.x.y will indicat
71128
of `epi_df`s to let `{epipredict}` work more easily with other libraries (#471).
72129
- Removed some external package dependencies.
73130

74-
## Breaking Changes
75-
76-
- `epi_df`'s are now more strict about what types they allow in the time column.
77-
Namely, we are explicit about only supporting `Date` at the daily and weekly
78-
cadence and generic integer types (for yearly cadence).
79-
- `epi_slide` `before` and `after` arguments are now require the user to
80-
specific time units in certain cases. The `time_step` argument has been
81-
removed.
82-
- `epix_slide` `before` argument now defaults to `Inf`, and requires the user to
83-
specify units in some cases. The `time_step` argument has been removed.
84-
85131
# epiprocess 0.7.0
86132

87133
## Breaking changes:

0 commit comments

Comments
 (0)