Skip to contents

The tbl_now class

Create one, check it, and move between the three data types.

tbl_now() stable
Create a tbl_now object
as_tbl_now() stable
Transform an object into a tbl_now
validate_tbl_now() is_tbl_now() stable
Check that an object is a valid tbl_now
tbl_now_attributes() stable
List what a tbl_now was told about itself
to_count() stable
Convert between linelist and aggregated count data

Attributes

Read what the object was told about itself, and change it.

Reshaping

Put the data on the grid a model needs.

aggregate_time_units() stable
Coarsen a tbl_now onto a bigger time unit
align_weeks() week_2_date() stable
Put weekly data on a common weekday
complete_zeroes() stable
Fill in the days when nothing was reported
censor_reporting_delays_above() censor_reports() censor_reporting_delays() censor_revisions() censor_revision_delays() censor_revision_delays_above() stable
Record a report or a delay as a bound rather than a fact
is_weekday() stable
Is a date a weekday or a weekend?

Temporal effects

Calendar structure, recorded lazily and materialised on demand.

temporal_effects() stable
Calendar effects to include in a nowcast
add_temporal_effects() compute_temporal_effects() stable
Attach calendar effects to a tbl_now, and turn them into columns

The revision process

The optional third date, and the outcomes it carries.

get_latest_revised_cases() get_initial_revised_cases() get_nth_revised_cases() stable
Cases at a chosen point in the revision process
diagnose_revision_delay() stable
Compare revision delays between confirmed and retracted cases

Summarising

What is in the data. summary() returns a tibble, and every block of it is also a function of its own.

Diagnosing

What is wrong with the data. diagnose() is structural and deterministic; the statistical tests are listed after it.

diagnose() experimental
Diagnose a tbl_now
diagnose_declarations() diagnose_ordering() diagnose_missing() diagnose_duplicates() diagnose_units() diagnose_negatives() diagnose_now() diagnose_truncation() diagnose_strata() stable
Individual blocks of a tbl_now diagnosis
print(<tbl_now_diagnosis>) stable
Print a tbl_now diagnosis
diagnose_drift() stable
Test whether the reporting-delay distribution drifts over time
diagnose_changepoint() stable
Detect an abrupt change point in the reporting-delay distribution
diagnose_batches() experimental
Screen the report axis for batched reporting
diagnose_batches2() experimental
Test whether one report date drew from unusually old event dates
transport_discriminant() experimental
The transport discriminant of a reporting series
simulate_batch() experimental
Inject a batch into a tbl_now by withholding and then releasing reports

Plots

One grid, or any panel of it on its own.

tbl_now_palette()
The tbl.now colour palette
autoplot(<tbl_now>) experimental
Diagnostic autoplot for a tbl_now
diagnostic_plot() stable
Diagnostic plots of the reporting process
plot_day_of_week_effects() plot_week_of_year_effects() plot_month_of_year_effects() plot_holiday_effects() plot_weekend_effects() plot_holiday_lag_effects() stable
Calendar effects on the case counts or on the reporting delay
plot_revision_status() stable
How much of each day has been resolved
plot_cycles() stable
Periodogram of the case counts or of the reporting delay
plot_delay_distribution() stable
Empirical distribution of the reporting or revision delay
plot_delay_drift() stable
Visualise whether the reporting-delay distribution drifts over time
plot_delay_profiles() stable
Plot the per-date delay profiles
plot_reporting_process() plot_epidemic_process() stable
The epidemic process and the reporting process
plot_observed_cases() stable
Observed epidemic process with the incompleteness line
plot_reporting_hexamap() stable
Plot the reporting triangle as an age-period-cohort hexamap
plot_reporting_triangle() stable
Plot the reporting triangle
plot_transport_discriminant() stable
Plot the transport-discriminant plane

Fitting nowcasts

One interface over the modelling packages.

run_nowcast() stable
Nowcast a tbl_now with any supported modelling package
engine() stable
Specify a nowcasting model and its arguments
engine_diseasenowcasting() engine_baselinenowcast() engine_epinowcast() engine_nobbs() engine_surveillance() engine_epinow2() stable
Engines for the built-in nowcasting packages
example_engine() nowcast_fit(<example>) nowcast_tidy(<example>) stable
A toy engine for examples
is_nowcast_engine() stable
Is this an engine?
list_nowcast_methods() stable
List the available nowcasting methods
nowcast_fit() stable
Fit a nowcast with one modelling package
nowcast_tidy() stable
Standardise a fitted nowcast
tbl_nowcast() stable
A nowcast produced by run_nowcast()
is_tbl_nowcast() stable
Is this object a tbl_nowcast?
nowcast_quantile_levels() stable
Default quantile levels for a nowcast
autoplot(<tbl_nowcast>) experimental
Plot a nowcast
as_tibble(<tbl_nowcast>) stable
Coerce a tbl_nowcast into a tibble

Ensembles, backtests and scoring

nowcast_ensemble() stable
Combine several nowcasts into an ensemble
nowcast_weights() stable
Ensemble weights from a backtest
nowcast_backtest() stable
Refit several methods at past now dates and score them
score_nowcast() as_forecast_quantile(<nowcast_backtest>) as_forecast_point(<nowcast_backtest>) as_forecast_sample(<nowcast_backtest>) stable
Score a nowcast against observed data

Converters

Out to the modelling packages, and back again.

tbl_now_to_EpiNow2() tbl_now_from_EpiNow2() experimental
Convert between tbl_now and EpiNow2
tbl_now_from_baselinenowcast() tbl_now_to_baselinenowcast() stable
Convert between tbl_now and baselinenowcast
tbl_now_from_data_table() tbl_now_to_data_table() stable
Convert between tbl_now and data.table
tbl_now_from_epidist() tbl_now_to_epidist() experimental
Convert between tbl_now and epidist
tbl_now_from_epinowcast() tbl_now_to_epinowcast() stable
Convert between tbl_now and epinowcast
tbl_now_to_nobbs() stable
Convert a tbl_now into the line list NobBS nowcasts from
tbl_now_to_surveillance() stable
Convert a tbl_now into the line list surveillance nowcasts from
tbl_now_from_tsibble() tbl_now_to_tsibble() stable
Convert between tbl_now and tsibble
as_epidist_linelist_data(<tbl_now>) as_epidist_aggregate_data(<tbl_now>) as_reporting_triangle(<tbl_now>) as_tsibble(<tbl_now>) as.data.table(<tbl_now>) stable
Coerce a tbl_now with another package's generic
print(<tbl_now_epinow2_snapshots>) stable
Snapshots of one series, as EpiNow2 estimates truncation from
print(<tbl_now_triangle_list>) stable
One reporting triangle per stratum
print(<tbl_now_surveillance_list>) stable
One surveillance line list per stratum
get_surveillance_when() get_surveillance_range() stable
The date grids surveillance::nowcast() needs

Tidying model output

Every engine’s result, in one shape.

tidy() stable
Tidy a fitted nowcast into one standard table
tidy(<tbl_nowcast>) stable
Tidy a nowcast produced by run_nowcast() or nowcast_ensemble()
tidy(<nowcast_backtest>) stable
Tidy the predictions and scores of a nowcast_backtest()
tidy(<estimate_dist>) tidy(<epidist_fit>) stable
Tidy a fitted delay distribution

dplyr integration

The methods that keep the class alive inside a pipeline.

Datasets

covid_colombia
COVID-19 Notifications – Colombia 2020-2023
covid_us
covid_us: CDC COVID-19 Case Surveillance Public Use Data (2020)
denguedat
denguedat: Dengue fever individual-level reporting data from Puerto Rico
flusight
flusight: NHSN Weekly Hospital Respiratory Data from FluSight
hai_bucaramanga
Healthcare-Associated Infections – Bucaramanga, Colombia 2020-2023
mpoxdat
mpoxdat: Mpox reporting data from the 2022 New York City outbreak
sari_bh
sari_bh: Severe Acute Respiratory Illness data from Belo Horizonte (Brazil), 2020-2022