Skip to content

Commit

Permalink
CRAN check fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
seabbs committed Jul 8, 2022
1 parent 7fcc6e2 commit 194862e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This is a major release and contains multiple breaking changes. If needing the o
* A new helper function `enw_delay_metadata()` has been added. This produces metadata about the delay distribution vector that may be helpful in future modelling. This prepares the way for [#4](https://github.com/epiforecasts/epinowcast/issues/4) where this data frame will be combined with the reference metadata in order to build non-parametric hazard reference and delay based models. In addition to adding this function, it has also been added to the output of `enw_preprocess_data()` in order to make the metadata readily available to end-users. See [#80](https://github.com/epiforecasts/epinowcast/pull/80) by [@seabbs](https://github.com/seabbs).
* Two new helper functions `enw_filter_reference_dates()` and `enw_filter_report_dates()` have been added. These replace `enw_retrospective_data()` but allow users to similarly construct retrospective data. Splitting these functions out into components also allows for additional use cases that were not previously possible. Note that by definition it is assumed that a report date for a given reference date must be the equal or greater (i.e a report cannot happen before the event being reported occurs). See [#82](https://github.com/epiforecasts/epinowcast/pull/82) by [@sbfnk](https://github.com/sbfnk) and [@seabbs](https://github.com/seabbs).
* The internal grouping variables have been refactored to reduce the chance of clashes with columns in the data frames supplied by the user. There will also be an error thrown in case of a variable clash, making preprocessing safer. See [#102](https://github.com/epiforecasts/epinowcast/pull/102) by [@adrian-lison](https://github.com/adrian-lison) and [@seabbs](https://github.com/seabbs), which solves [#99](https://github.com/epiforecasts/epinowcast/issues/99).
* Support for preprocessing observations with missing reference dates has been added along with a new data object returned by `enw_preprocess_data()` that highlights this information to the user (alternatively can be accessed by users using `enw_missing_reference()`). In addition, these missing observations have been setup to be passed to stan in order to allow their use in modelling. This feature is in prepartion of adding full support for missing observations (see [#43](https://github.com/epiforecasts/epinowcast/issues/43)). See
* Support for preprocessing observations with missing reference dates has been added along with a new data object returned by `enw_preprocess_data()` that highlights this information to the user (alternatively can be accessed by users using `enw_missing_reference()`). In addition, these missing observations have been setup to be passed to stan in order to allow their use in modelling. This feature is in preparation of adding full support for missing observations (see [#43](https://github.com/epiforecasts/epinowcast/issues/43)). See
[#106](https://github.com/epiforecasts/epinowcast/pull/106) by [@adrian-lison](https://github.com/adrian-lison) and [@seabbs](https://github.com/seabbs).

## Model
Expand Down
4 changes: 2 additions & 2 deletions R/preprocess.R
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ enw_filter_report_dates <- function(obs, latest_date, remove_days) {
#'
#' @param include_days if \code{earilest_date} is not given, the number
#' of reference dates to include, ending with the latest reference
#' date included once reporting dates have been removed. If specifed
#' date included once reporting dates have been removed. If specified
#' this is indexed to `latest_date` or `remove_days`.
#'
#' @param latest_date Date, the latest reference date to include in the
Expand Down Expand Up @@ -591,7 +591,7 @@ enw_delay_metadata <- function(max_delay = 20, breaks = 4) {
#' of [enw_preprocess_data()] for more on the expected inputs.
#'
#' @param obs Observations with the addition of empirical reporting proportions
#' and and restricted to the specified maximum dela.
#' and and restricted to the specified maximum delay.
#'
#' @param new_confirm Incidence of notifications by reference and report date.
#' Empirical reporting distributions are also added.
Expand Down
6 changes: 4 additions & 2 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CmdStan
CmdStanR
CmdStanR's
CmdStanR’s
Cmdstan
Codecov
Höhle
ImperialCollegeLondon
Expand All @@ -13,13 +14,16 @@ Lifecycle
LogNormal
Nowcast
Nowcasting
ORCID
PARAM
Poisson
Rstan
aem
com
discretised
enw
epidemia
fns
formulatools
frac
geq
Expand All @@ -38,7 +42,6 @@ nowcast
nowcasting
nowcasts
overprediction
parallisation
parameterisations
postprocess
postprocessing
Expand All @@ -52,5 +55,4 @@ startsWith
sundays
th
tradeoffs
treatss
underprediction
2 changes: 1 addition & 1 deletion man/enw_construct_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/enw_filter_reference_dates.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tests/testthat/test-enw_missing_reference.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ test_that("enw_missing_reference works as expected given correct input data", {
new_confirm = c(1, rep(0, 11), 4)
)
exp_obs <- data.table::data.table(
.group = 1, location = "DE",
report_date = as.IDate(
seq.Date(as.Date("2021-10-01"), as.Date("2021-10-04"), by = "day")
),
seq.Date(as.Date("2021-10-01"), as.Date("2021-10-04"), by = "day")
),
.group = 1, location = "DE",
confirm = c(rep(0, 3), 4), prop_missing = c(0, NaN, NaN, 1)
)
expect_equal(enw_missing_reference(obs), exp_obs)
Expand Down

0 comments on commit 194862e

Please sign in to comment.