All functions

add_missing_isoweeks()

Add missing isoweeks to an aggregated dataframe of case counts by year and week

age_format_check()

Age Group Format Check

age_groups()

Creates age grouping variable for a given data set

aggregate_data()

Aggregates case data (linelist, i.e. one row per case) by isoyear and isoweek and adds missing isoweeks to the aggregated dataset. Additionally number of cases part of a known outbreak is added if the variable outbreak_status exists in the data.

aggregate_signals()

Aggregate cases and signals over the number of weeks. First the signals are filtered to obtain the signals for the last n weeks aggregating the number of cases observed, create variable any signal generated and the aggregate the number of signals

algo.cusum_with_reset()

Implementation of the CUSUM algorithm retrieved from the surveillance package and adapted so that after a signal was triggered the cusum is set to 0 Parameters are inherited from surveillance algo.cusum

available_algorithms()

List Available Signal Detection Algorithms

build_empty_datatable()

Create an Empty DataTable with a Custom Message

build_signals_agg_table()

Builds the aggregated signal detection results table with different formating options.

build_signals_table()

Builds the signal detection results table with different formating options. To get the raw data.frame containing method ald number_of_weeks as well use format = "data.frame", to obtain nicely formated tables in an interactive DataTable or as Flextable use format = "DataTable" or format = "Flextable".

check_any_age()

Helper function to check for presence of age variable or instead age_group

check_character_levels()

Helper to check that values of a character variable are in given levels

check_empty_rows()

check whether there is a completely empty row in provided surveillance data

check_for_missing_values()

Varible names which should be checked for missing values

check_mandatory_variables()

checking mandatory variables in the surveillance data check if mandatory variables are present in the data check if they have the correct type and correct values

check_presence_mandatory_variables()

checking presence of mandatory variables in surveillance data

check_raw_surveillance_data()

Checking whether raw surveillance linelist fulfills requirements to the data specified in the SOP Checking presence and correct type of mandatory variables Checking type and values of optional variables

check_region_region_id_consistency()

Check whether the region and corresponding region_id columns only have one region name per ID

check_type_and_value_age_group()

Checking type and values of the age_group column

check_type_and_value_case_id()

Checking type of case_id, duplication or missing case_id

check_type_and_value_date()

Checking type and values of date variables date variable can be of type character or date

check_type_and_value_mandatory_variables()

Checking those mandatory variables which are present in the data for their type

check_type_and_value_optional_variables()

Checking correct type and value of optional variables which are present in the data

check_type_and_value_yes_no_unknown()

Checking type and values of variables which should have yes,no,unknown values

complete_agegrp_arr()

Complete Age Group Array

conjure_filename()

Conjure Filename

convert_columns_integer()

Convert specified columns to integer type

convert_to_sts()

Turns aggregated data into surveillance's sts format

create_age_group_levels()

Creation of age_group levels from different formats of the age_group column

create_barplot_or_table()

Decider function to create barplot or table of aggregated cases with signals Depending on the number of unique levels to visualise it is decided whether a barplot or a table is shown. The aggregated number of cases for each stratum and whether any signal are shown.

create_baseline()

Create a data.frame with a constant baseline for an intercept only regression model.

create_factor_with_unknown()

Create a factor out of the stratum column with transforming NA to unknown

create_fn_data()

Create a data.frame with 10 seasgroups components for harmonic modeling.

create_formula()

Create a model formula based on the columns in the model_data dataframe.

create_map_or_table()

Decider for creating a map or a table based on whether all NUTS_ids are found in the shapefile

create_model_data()

Create Model Data for Generalized Linear Modeling

create_sincos_data()

Create a data.frame with sine and cosine components for harmonic modeling.

create_time_trend()

Create a data.frame with variable time trend for regression modeling.

cusum_with_reset()

Wrapper around the algo.cusum_with_reset Copied from the code of the surveillance package and adapted for algo.cusum_with_reset

decider_barplot_map_table()

Decider function whether create_map_or_table or create_barplot_or_table is used

filter_by_date()

Filter Data Frame by Date Range

filter_data_last_n_weeks()

Filter the data so that only the data of the last n weeks are returned This function can be used to filter for those last n weeks where signals were generated.

find_age_group()

Finds correct age interval for given age

format_table()

Format the signal results to an interactive or static table

get_case_id_duplicates()

Checking for duplicates in case_id

get_database_connection()

Establish a Database Connection (Example Implementation)

get_data_config_value()

Retrieve a Configuration Value from DATA_CONFIG

get_empty_columns()

Retrieveing which columns in the dataset only contain missing values

get_float_columns()

Get the numeric columns that are not integer columns

get_intervention_timepoint()

Get row number of aggregated data which is the isoweek and isoyear corresponding to the date given

get_iso_week_year()

Get isoweek and isoyear from a given date

get_missing_data()

retrieve 'case_id's which have missing values in computationally crucial variables

get_name_by_value()

Function to retrieve name from named vector given its value Can be used to retrieve the "pretty" names to show to the user and in the background work with the values

get_possible_glm_methods()

Get Possible GLM Methods Based on Available Data

get_region_from_region_id()

Function to extract corresponding region to the region_id variable

get_region_id_from_region()

Function to get the region_id variable names from the region variables

get_shp_config_or_internal()

Get Shapefile: Read from Config or Use Internal Dataset

get_signals()

Get Signals

get_signals_aeddo()

Automated and Early Detection of Disease Outbreaks

get_signals_cusum()

Get signals of CUSUM algorithm with reset

get_signals_ears()

Get signals of surveillance's EARS algorithm

get_signals_farringtonflexible()

Get signals of surveillance's farringtonFlexible algorithm

get_signals_glm()

Get signals based on a weigthed GLM quasipoisson regression model for the expected case counts The GLM is flexible being able to just fit a mean, add a time trend, fit a harmonic sin/cos model or the seasons from the farringtonflexible.

get_signals_stratified()

Get Signals Stratified

get_unused_variables()

retrieve variables which are in provided in surveillance linelist but are not used in the tool

get_valid_dates_intervention_start()

Get a default and minimum and maximum date for the intervention time point for the glm algorithms with pandemic correction. This is based on the data provided and the settings for the delays.

input_example

Example input data

input_metadata

Input metadata

isoweek_to_date()

Create a Date from ISO Year and Week

is_age_group_format()

checking age_group column only containing digits, separators and <,>,+ For the first age_group using seperator, i.e. 00-05, <5 is allowed. For the last age group using seperators, i.e. 95-100, >100 and 100+ is allowed. Separators like - (dash), _ (underscore), and — (em dash) are also allowed for intermediate age ranges.

is_ISO8601()

checking YYYYY-mm-dd format of date variables

is_ISO8601_detailed()

detailed check of date variables check that months are numbers between 01-12 and days are from 01-31

is_last_age_group_format()

checking the format of the last/biggest age group to follow the format digit separator digit, digit+ or >digit

load_data_db()

Load Data from Database (Example Implementation)

nuts_shp

NUTS-Regions

pad_signals()

Extend the computed threshold and expectation of the signal detection method to the past for visualisation purposes but not for signal generation Inside the function it is computed what the maximum number of timepoints is the signal detection algorithms can be applied for. This depends on the algorithm and the amount of historic data. The already generated signals dataframe is then extended with the expectation and threshold into the past

plot_agegroup_by()

Plot age-groups grouped by another variable

plot_barchart()

Barplot visualising the number of cases and information about any signals

plot_regional()

Plot number of cases with number of signals by region

plot_time_series()

Plot time-series based on the results of a signal detection algorithm, being alarms, threshold and expectation

prepare_signals_agg_table()

Prepares aggregated signals of one category for producing a table.

prepare_signals_table()

Prepare the signal detection results for creation of table with results

preprocess_data()

Preprocessing of linelist surveillance data with or without outbreak_ids

query_database()

Query Database (Example Implementation)

read_csv_both_sep()

Read csv files which can have seperators ; or ,

read_csv_or_excel()

Read csv or excel files Checks the input file for its type and then reads the file

region_id_variable_names()

Variable names of the region_id variables including those which do not necessarily follow NUTS format

region_variable_names()

Variable names of the region_id variables including those which do not necessarily follow NUTS format

remove_empty_columns()

Removing columns from data which only contain missing values

run_app()

Run the Shiny Application

run_report()

Renders signal detection report

save_signals()

Save signals

sex_levels()

Allowed levels for sex in preprocessed surveillance data used for all calculations

sex_raw_levels()

Allowed levels for sex in raw surveillance data

transform_required_format()

Transform Data to Required Format (Example Implementation)

yes_no_unknown_levels()

Allowed levels for variables with yes, no, unknown levels in preprocessed surveillance data used for calculations

yes_no_unknown_raw_levels()

Allowed levels for variables with yes, no, unknown levels in raw surveillance data

yes_no_unknown_variables()

Variable names of the variables which have yes, no , unknown levels