Skip to content

Commit 58ce1d0

Browse files
committed
Fix + add NEWS.md entries
We actually coincidentally caught the tibble-to-DT key-setting issue with code intended for addressing a separate issue with `data.table`s passed in.
1 parent 27ff6dd commit 58ce1d0

File tree

3 files changed

+30
-22
lines changed

3 files changed

+30
-22
lines changed

NEWS.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.x.y will indicat
66

77
## Breaking changes
88

9-
- `new_epi_archive()`'s `x` argument has been replaced with a `data_table`
10-
argument, which must be a `data.table` with the key already set appropriately.
11-
The `key()` of its `DT` will also now place `other_keys` before rather than after
12-
`"time_value"`.
9+
- The low-level `new_epi_archive()` function's `x` argument has been replaced
10+
with a `data_table` argument, which now has extra requirements; see
11+
`?new_epi_archive`. Users should still be using `as_epi_archive()` unless they
12+
have a need for something lower-level.
1313

14-
## Bug fixes
14+
## New features
1515

16-
- `as_epi_archive()` no longer has issues setting its `DT`'s `key` on some
17-
versions of `{data.table}` when `x` is a tibble.
16+
- `epi_slide_{mean,sum,opt}` now work on `epi_archive`s, preparing version
17+
histories for 7-day-averages of signals, etc.
1818

1919
# epiprocess 0.11
2020

R/archive.R

+12-8
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,21 @@ next_after.Date <- function(x) x + 1L
186186
#' archive. Unexpected behavior may result from modifying the metadata
187187
#' directly.
188188
#'
189-
#' @param data_table a data.table with [`data.table::key()`] equal to
190-
#' `c("geo_value", other_keys, "time_value", "version")`.
189+
#' @param data_table a `data.table` with [`data.table::key()`] equal to
190+
#' `c("geo_value", other_keys, "time_value", "version")`. For `data.table`
191+
#' users: this sets up an alias of `data_table`; if you plan to keep on
192+
#' working with `data_table` or working directly with the archive's `$DT`
193+
#' using mutating operations, you should `copy()` if appropriate. We will not
194+
#' mutate the `DT` with any exported {epiprocess} functions, though.
191195
#' @param geo_type DEPRECATED Has no effect. Geo value type is inferred from the
192-
#' location column and set to "custom" if not recognized.
193-
#' @param time_type DEPRECATED Has no effect. Time value type inferred from the time
194-
#' column and set to "custom" if not recognized. Unpredictable behavior may result
195-
#' if the time type is not recognized.
196+
#' location column and set to "custom" if not recognized.
197+
#' @param time_type DEPRECATED Has no effect. Time value type inferred from the
198+
#' time column and set to "custom" if not recognized. Unpredictable behavior
199+
#' may result if the time type is not recognized.
196200
#' @param other_keys Character vector specifying the names of variables in `x`
197201
#' that should be considered key variables (in the language of `data.table`)
198-
#' apart from "geo_value", "time_value", and "version". Typical examples
199-
#' are "age" or more granular geographies.
202+
#' apart from "geo_value", "time_value", and "version". Typical examples are
203+
#' "age" or more granular geographies.
200204
#' @param compactify Optional; `TRUE`, `FALSE`, or `"message"`. `TRUE` will
201205
#' remove some redundant rows, `FALSE` will not. `"message"` is like `TRUE`
202206
#' but will emit a message if anything was changed. Default is `TRUE`. See

man/epi_archive.Rd

+11-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)