Releases: reconverse/incidence2
v2.4.0
-
incidence()
gains afill
parameter. This is passed tocomplete_dates()
so is only valid when the argumentcomplete_dates = TRUE
. -
For convenience we now reexport
select()
from
dplyr as well as
unnest()
andunpack()
from tidyr. -
Alt text has been added to all vignette images.
-
Improved input checking for
keep_first()
andkeep_last()
.
v2.3.1
Incidence release v2.3.0
New functions / features:
-
The
bootstrap_incidence()
,estimate_peak()
andfirst_peak()
functions have been integrated from the downstream i2extras package. -
Added group-aware methods for common generics in base R, dplyr and tidyr:
split.incidence2()
mutate.incidence2()
summarise.incidence2()
nest.incidence2()
-
Added coercion methods for tibble and data.table:
as_tibble.incidence2()
as.data.table.incidence2()
-
New methods,
$<-.incidence2
andrbind.incidence2
, that drop the incidence2 class if the required invariants are broken. -
New functions
incidence_()
andregroup_()
that work similar to their existing namesakes save for additional support for
tidy-select semantics in some of their arguments. -
Named vectors can now be used for the
groups
andcounts
arguments ofincidence()
to allow renaming prior to aggregation. Previously this was only possible with thedate_index
input. -
incidence()
gains acomplete_dates
argument defaulting toFALSE
. If set this is equivalent of a call toincidence()
followed by a call tocomplete_dates()
with the default arguments. Users wanting more flexibility can still call thecomplete_dates()
function with different arguments.
Breaking changes:
-
All of the aforementioned new methods would previously have dispatched on the underlying data.frame method. If you were relying on this behaviour then you will now need to add a call to
as.data.frame()
prior to continuing your pipeline. -
incidence2
objects are now built upon tibbles rather than standard data frames. This means where we do not provide methods forincidence2
objects tibble (as opposed to data.frame) methods will be called. An overview of the differences between tibbles and data.frames can be found at https://tibble.tidyverse.org/articles/invariants.html. -
incidence()
now warns if a count variable contains missing values and encourages users to handle these prior to calling incidence()`. -
The package now has a hard dependency on the R version (>= 4.1.0).
incidence2 2.2.3
incidence2 2.2.1
New features
plot.incidence2()
gains argumentsn_breaks
,fill
,show_cases
andlegend
allowing for a wider range of plot styles. Seevignette("incidence2", package = "incidence2")
for examples.
incidence2 2.1.0
New features
- Specifying
interval = "day"
orinterval = daily
in a call to incidence
will force the resultantdate_index
variable to be a<Date>
. Functionally
this is a wrapper aroundas.Date()
that ensures the underlying data are
whole numbers and that time zones are respected.
(minor) breaking changes
-
incidence()
will now warn if objects are created with POSIXct columns.
The motivation for this is that, internally, objects are represented
as seconds since the UNIX epoch and, in our experience, this level of
granularity is not normally desired for aggregation. -
The
by
parameter ofcomplete_dates()
is now defunct. This was previously
passed to an underlyingseq
function when, in practice, it should always
have been forced to 1 to match the precision of the underlying date_index. -
complete_dates()
will now error if called on an input with a
date_index. Users must now explicitly set the argumentallow_POSIXct = TRUE
to maintain old behaviour.
incidence2 2.0.0
Version 2.0.0 is a major, breaking release of incidence2. We have undertaken a
significant refactor that both simplifies the underlying code base and makes the
user interface more consistent and robust. Although the main changes are
highlighted below, users are strongly advised to read through the accompanying
documentation and vignettes.
breaking changes
-
We no longer support NSE (e.g. tidyselect semantics) within the package. Our
motivation for removing support for NSE are both the complexity it can bring
to the underlying code (making long term maintenance harder) and the
complexity it can cause for other users / developers who want to build on
top of incidence2. -
new_incidence()
,validate_incidence()
,build_incidence()
,get_n()
,
get_interval()
,get_timespan()
andfacet_plot()
are now defunct and
will error if called. -
complete_counts()
is now renamedcomplete_dates()
and gains two new
parameters,expand
andby
. Ifexpand
is TRUE (default) then
complete_dates()
will attempt to use
function(x) seq(min(x), max(x), by = by)
to generate a complete sequence of
dates. -
The
incidence()
function now always returns output in long format with
dedicated columns for the count variables and values (set by arguments
count_names_to
andcount_values_to
). -
incidence()
is now less flexible in what it can accept for theinterval
argument. For more complex date groupings users are encouraged to perform
their require data transformations prior to callingincidence()
. -
The default plotting of incidence objects as been greatly simplified. Sensible
defaults have been chosen to enable a quick visual overview of incidence
objects but users are advised to call ggplot2 directly for more bespoke
plotting.
incidence2 1.2.2
Bug fixes
- Fixes bug when input object to incidence is a data.table.
incidence2 1.2.1
Bug fixes
- Fixes bug in
incidence()
when more than one column was given for the date_index. - Fixes incorrect test that did not take in to account changing time zones.
incidence2 1.2.0
New functions
new_incidence()
: A minimal incidence constructor.validate_incidence()
: Check for internal consistency of incidence-like object.build_incidence()
: Allows you to construct an incidence object whilst specifying
your own date grouping function.format.incidence()
Deprecated functions
cumulate()
will now give a deprecation error. We have removed the function
to avoid users erroneously regressing against a cumulative count.
Bug fixes
- Fixes bug in
incidence()
when dates were a character vector and the the
default, daily, interval was specified.
Other updates
- Now uses
dplyr
to handle list based columns (e.g. record-type objects from
vctrs
). For data.frames with only atomic columns, data.table is still used. - Printing and summaries of incidence objects have been improved to remove
duplication in the overview section.