All functions

add_days_of_week_columns()

Add columns for days of the week to smoothed data

build_prediction_table()

Given the configuration and prediction data frame, build a prediction table

create_cbc_features()

Construct a tibble containing the quartiles of the CBC values and lagged features

create_dataset()

Construct a dataset for use in forecasting

get_SBC_config()

Get the global package variable sbc_config.

get_prediction_and_usage()

Get the actual prediction and platelet usage data from saved files for each date

ma()

Computing moving average of all past values including last value using a window size

model_config_changed()

Check if model parameters have changed in two configurations.

ms()

Computing moving sum of all past values including last value using a window size

predict_for_date()

Predict usage for a specified date

process_all_cbc_files()

Process all cbc files in a folder and generate qc reports

process_all_census_files()

Process all census files in a folder and generate qc reports

process_all_inventory_files()

Process all inventory files in a folder and generate qc reports

process_all_transfusion_files()

Process all transfusion files in a folder and generate qc reports

process_data_for_date()

Process data for a particular date by reading files per configuration and date

read_one_cbc_file()

Read a single cbc file data and return it, as is

read_one_census_file()

Read a single census file data and return it, as is

read_one_inventory_file()

Read a single inventory file and return it, as is

read_one_transfusion_file()

Read a single transfusion file data and return it, as is

reset_config()

Reset the global package variable sbc_config

save_report_file()

Save a generated report file in the report folder with the appropriate name

sbc_dashboard()

Run the Stanford Blood Center dashboard app

scale_dataset()

Scale the dataset and return the scaling parameters

set_config_param()

Set SBC configuration parameter to a specified value

set_initial_collection_data()

Set the SBC initial number of units that will be collected for the first three days

set_initial_expiry_data()

Set the SBC initial number of units that will expire in a day and the next

smooth_cbc_features()

Smooth the CBC features using a moving average

summarize_and_clean_cbc()

Summarize and clean the raw cbc data

summarize_and_clean_census()

Summarize and clean the raw census data

summarize_and_clean_inventory()

Summarize and clean the raw transfusion data

summarize_and_clean_transfusion()

Summarize and clean the raw transfusion data