- No user facing changes.
- No user facing changes.
- Documentation tweaks and general upkeep for CRAN.
- change of maintainer only.
plot.incidence()
now reverts to the previous behaviour of plotting ticks on either side of the interval as opposed to centering within the interval.- The default version for {ggplot2} has been set to 3.3.2.
- Fix for a bug in
plot.incidence()
introduced with new release of ggplot2 (bug report) As a temporary fix, dates are now centered within the interval instead of to the left of the interval.
- Any interval
seq.Date()
can handle (e.g. "5 weeks") can be handled byincidence()
(see #67) - Weekly intervals can start on any day of the week by allowing things like "epiweek", "isoweek", "wednesday week", "2 Saturday weeks", etc. (see #55 (comment))
- the item
$weeks
is now added to the incidence object, which contains an "aweek" class - plotting will now force the first tick to be the starting point of the incidence curve
make_breaks()
will automatically calculate breaks from an incidence object for plotting.scale_x_incidence()
will produce a ggplot2 "ScaleContinuous" object to add to a ggplot.
plot.incidence()
argumentlabels_iso
is deprecated in favor oflabels_week
- Incidence objects will still have
$isoweeks
if the weeks are ISO 8601 standard, but users should rely intead on$weeks
instead. The$isoweeks
element will be removed in a future version of incidence. as.incidence()
argumentisoweeks
has been deprecated in favour ofstandard
- ISOweek import changed to aweek
- Vignettes have been updated with examples.
incidence()
will no longer allow a non-standardfirst_date
to overridestandard = TRUE. The first call to
incidence()specifying
first_datewithout
standardwill issue a warning. To use non-standard first dates, specify
standard = FALSE. To remove the warning, use
options(incidence.warn.first_date = FALSE)`. See #87 for details.
citation("incidence")
will now give the proper citation for our article in F1000 research and the global DOI for archived code. See https://github.com/reconhub/incidence/pulls/106- Tests have been updated to avoid randomisation errors on R 3.6.0 See #107
incidence()
now returns an error when supplied a character vector that is not formatted as (yyyy-mm-dd). (See #88)fit()
now returns correct coefficients when dates is POSIXt by converting to Date. (See #91)plot.incidence()
now plots in UTC by default for POSIXt incidence objects. this prevents a bug where different time zones would cause a shift in the bars (See #99).
- A test that randomly failed on CRAN has been fixed. (See #95).
- Plotting tests have been updated for new version of vdiffr (See #96).
- POSIXct incidence are first passed through POSIXlt when initialized.
- A more informative error message is generated for non ISO 8601 formatted
first_date
andlast_date
parameters.
plot.incidence()
will now respect single groups. (See #84)as.data.frame.incidence()
will now respect single groups. (See #84)
demo("incidence-demo" package = "incidence")
has been updated to show use of custom colors.
print.incidence()
will now print isoweeks even if the$interval
element is "week".
subset.incidence()
will now give a more informative error message when the user specifies a group that does not exist.demo('incidence-demo', package = 'incidence')
now shows plotting withshow_cases = TRUE
.- In the the case where a date is accidentally mis-typed leading to a gross
mis-calculation of the date range (i.e. 2018 is mis-typed as 3018), a warning
will be issued. The default threshold is set at 18262 days (50 years), but the
user can define their own threshold by setting the
incidence.max.days
option
- Two bugs regarding the ordering of groups when the user specifies a factor/
column order have been fixed. This affects
plot.incidence()
,incidence()
, andas.data.frame.incidence()
For details, see #79
group_names()
allows the user to retrieve and set the group names.get_timespan()
returns the$timespan
element.get_n()
returns the$n
element.dim()
,nrow()
, andncol()
are now available for incidence objects, returning the dimensions of the number of bins and the number of groups.
- A new argument to
plot()
calledshow_cases
has been added to draw borders around individual cases for EPIET-style curves. See #72 for details.
- An example of EPIET-style bars for small data sets has been added to the plot customisation vignette by @jakobschumacher. See #68 for details.
- The incidence class vignette has been updated to use the available accessors.
estimate_peak()
no longer fails with integer datesincidence()
no longer fails when providing both group information and afirst_date
orlast_date
parameter that is inside the bounds of the observed dates. Thanks to @mfaber for reporting this bug. See #70 for details.
- code has been spread out into a more logical file structure where the
internal_checks.R
file has been split into the relative components. - A message is now printed if missing observations are present when creating the incidence object.
- The
$lm
field of theincidence_fit
class is now named$model
to clearly indicate that this can contain any model.
-
incidence()
will now accept text-based intervals that are valid date intervals: day, week, month, quarter, and year. -
incidence()
now verifies that all user-supplied arguments are accurate and spelled correctly. -
fit_optim_split()
now gains aseparate_split
argument that will determine the optimal split separately for groups. -
A new class,
incidence_fit_list
, has been implemented to store and summariseincidence_fit
objects within a nested list. This is the class returned by in the$fit
element offit_optim_split()
.
-
bootstrap()
will bootstrap epicurves stored asincidence
objects. -
find_peak()
identifies the peak date of anincidence
objects. -
estimate_peak()
uses bootstrap to estimate the peak time of a partially observed outbreak. -
get_interval()
will return the numeric interval or several intervals in the case of intervals that can't be represented in a fixed number of days (e.g. months). -
get_dates()
returns the dates or counts of days on the right, center, or left of the interval. -
get_counts()
returns the matrix of case counts for each date. -
get_fit()
returns a list ofincidence_fit
objects from anincidence_fit_list
object. -
get_info()
returns information stored in the$info
element of anincidence_fit
/incidence_fit_list
object.
- The new vignette
incidence_fit_class
instructs the user on howincidence_fit
andincidence_fit_list
objects are created and accessed.
- In the
incidence()
function, theiso_week
parameter is deprecated in favor ofstandard
for a more general way of indicating that the interval should start at the beginning of a valid date timeframe.
-
The
$timespan
item in the incidence object from Dates was not type-stable and would change if subsetted. A re-working of the incidence constructor fixed this issue. -
Misspelled or unrecgonized parameters passed to
incidence()
will now cause an error instead of being silently ignored. -
Plotting for POSIXct data has been fixed.
- tweak of the plotting of
incidence
object to avoid conflicts with additional geoms such asgeom_ribbon
, now used inprojections::add_projections
.
- fixed issue caused by new
version of
ggplot2
-
the argument
n_breaks
has been added toplot.incidence
, to specify the ideal number of breaks for the date legends; will work with ggplot2 > 2.2.1 -
added the internal function
make_iso_weeks_breaks
to generate dates and labels for date x-axis legends using ISO weeks -
added a function
add_incidence_fit
, which can be used for adding fits to epicurves in a piping-friendly way -
added a function
cumulate
, which computes cumulative incidence and returns anincidence
object
- fixed issues in testing incidence plots by employing vdiffr package.
-
new generic as.incidence, to create incidence objects from already computed incidences. Methods for: matrix, data.frame, numeric vectors
-
better processing of input dates, including: automatic conversion from characters, issuing errors for factors, and silently converting numeric vectors which are essentially integers (issuing a warning otherwise)
-
new vignette on conversions to and from incidence objects
-
new tests
-
fixed issues caused by variables which changed names in some datasets of the outbreaks package, used in the documentation
-
disabled by default the isoweeks in
incidence
; this part of the code will break with changes made in the devel version of ggplot2, which is now required by plotly
-
it is now possible to subset an incidence object based on
Date
dates using numeric values, which are interpreted as number of intervals since the first date (origin = 1) -
NAs are no longer removed from the input dates, as it would cause mismatches with grouping factors.
- adapting to new names of datasets in
outbreaks:
ebola.sim
->ebola_sim
andebola.sim.clean
->ebola_sim_clean
-
add an argument
iso_week
to incidence.Date() and incidence.POSIXt() to support ISO week-based incidence when computing weekly incidence. -
add an argument
labels_iso_week
to plot.incidence() to label x axis tick marks with ISO weeks when plotting ISO week-based weekly incidence.
-
The README.Rmd / README.md now contains information about various websites for incidence as well as guidelines for posting questions on the RECON forum.
-
incidence now has a dedicated website https://www.repidemicsconsortium.org/incidence/ generated with pkgdown
- Vignettes titles are now correctly displayed on CRAN (they read 'Vignette title').
First release of the incidence package on CRAN!