Skip to content

Commit b6a7d58

Browse files
committed
Merge branch 'dev' into ndefries/epidatasets-migration
2 parents e04f5a7 + 44e7095 commit b6a7d58

Some content is hidden

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

74 files changed

+4225
-3790
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ docs
1313
renv/
1414
renv.lock
1515
.Rprofile
16+
sandbox.R

DESCRIPTION

Lines changed: 29 additions & 20 deletions
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,27 +15,35 @@ 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"),
21-
person("Johns Hopkins University Center for Systems Science and Engineering", role = "dtc", comment = "Owner of COVID-19 cases and deaths data from the COVID-19 Data Repository"),
22-
person("Johns Hopkins University", role = "cph", comment = "Copyright holder of COVID-19 cases and deaths data from the COVID-19 Data Repository"),
23-
person("Carnegie Mellon University Delphi Group", role = "dtc", comment = "Owner of claims-based CLI data from the Delphi Epidata API")
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"),
24+
person("Johns Hopkins University Center for Systems Science and Engineering", role = "dtc",
25+
comment = "Owner of COVID-19 cases and deaths data from the COVID-19 Data Repository"),
26+
person("Johns Hopkins University", role = "cph",
27+
comment = "Copyright holder of COVID-19 cases and deaths data from the COVID-19 Data Repository"),
28+
person("Carnegie Mellon University Delphi Group", role = "dtc",
29+
comment = "Owner of claims-based CLI data from the Delphi Epidata API")
2430
)
25-
Description: This package introduces a common data structure for epidemiological
26-
data reported by location and time, provides another data structure to
27-
work with revisions to these data sets over time, and offers associated
28-
utilities to perform basic signal processing tasks.
31+
Description: This package introduces a common data structure for
32+
epidemiological data reported by location and time, provides another
33+
data structure to work with revisions to these data sets over time,
34+
and offers associated utilities to perform basic signal processing
35+
tasks.
2936
License: MIT + file LICENSE
30-
Copyright: file inst/COPYRIGHTS
37+
URL: https://cmu-delphi.github.io/epiprocess/
38+
Depends:
39+
R (>= 3.6)
3140
Imports:
3241
checkmate,
3342
cli,
3443
data.table,
3544
dplyr (>= 1.0.8),
3645
epidatasets,
3746
genlasso,
38-
glue,
3947
ggplot2,
4048
lifecycle (>= 1.0.1),
4149
lubridate,
@@ -48,7 +56,8 @@ Imports:
4856
tidyselect (>= 1.2.0),
4957
tsibble,
5058
utils,
51-
vctrs
59+
vctrs,
60+
waldo
5261
Suggests:
5362
covidcast,
5463
devtools,
@@ -63,21 +72,21 @@ VignetteBuilder:
6372
Remotes:
6473
cmu-delphi/epidatasets,
6574
cmu-delphi/epidatr,
66-
reconverse/outbreaks,
67-
glmgen/genlasso
75+
glmgen/genlasso,
76+
reconverse/outbreaks
6877
Config/testthat/edition: 3
78+
Config/testthat/parallel: true
79+
Copyright: file inst/COPYRIGHTS
6980
Encoding: UTF-8
7081
LazyData: true
7182
Roxygen: list(markdown = TRUE)
7283
RoxygenNote: 7.3.2
73-
Depends:
74-
R (>= 2.10)
75-
URL: https://cmu-delphi.github.io/epiprocess/
7684
Collate:
7785
'archive.R'
7886
'autoplot.R'
7987
'correlation.R'
8088
'epi_df.R'
89+
'epi_df_forbidden_methods.R'
8190
'epiprocess.R'
8291
'group_by_epi_df_methods.R'
8392
'methods-epi_archive.R'

NAMESPACE

Lines changed: 10 additions & 0 deletions
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)
@@ -74,6 +81,7 @@ export(filter)
7481
export(full_seq)
7582
export(geo_column_names)
7683
export(group_by)
84+
export(group_epi_df)
7785
export(group_modify)
7886
export(growth_rate)
7987
export(guess_period)
@@ -90,6 +98,7 @@ export(relocate)
9098
export(rename)
9199
export(revision_summary)
92100
export(slice)
101+
export(sum_groups_epi_df)
93102
export(time_column_names)
94103
export(ungroup)
95104
export(unnest)
@@ -150,6 +159,7 @@ importFrom(dplyr,everything)
150159
importFrom(dplyr,filter)
151160
importFrom(dplyr,group_by)
152161
importFrom(dplyr,group_by_drop_default)
162+
importFrom(dplyr,group_map)
153163
importFrom(dplyr,group_modify)
154164
importFrom(dplyr,group_vars)
155165
importFrom(dplyr,groups)

NEWS.md

Lines changed: 58 additions & 12 deletions
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)