Skip to contents

Assemble a chronogram & add data

cg_assemble()
Assemble a chronogram
cg_add_experiment()
Add experimental data to a chronogram
cg_add_treatment()
Add treatment data to a chronogram

Annotate a chronogram

Episode annotation

Find episodes from results (tests, symptoms) on different calendar days

cg_annotate_episodes_find()
Find infections per individual
cg_annotate_episodes_find_seroconversion()
Find seroconversion episodes per individual
cg_annotate_episodes_fill()
Fill experimental, treatment or symptom information within an infection episode

Episode, vaccine & exposure counting

cg_annotate_episodes_count()
Calculate and assign flags based on infection history
cg_annotate_vaccines_count()
Calculate and assign flags based on vaccine history
cg_annotate_exposures_count()
Cumulative counting seroconversion episodes per individual
cg_annotate_antigenic_history()
Calculate and assign flags based on infection history

Filter, window & select a chronogram

cg_window_by_episode()
Pick a window of dates from a chronogram: with respect to episode start.
cg_window_by_metadata()
Pick a window before and after a metadata date column
cg_window_by_visit()
Pick a window of dates from a chronogram: with respect to visits.
cg_select()
Adapted dplyr::select() to include calendar dates and ID columns
cg_select_visit()
Select a visit within a windowed chronogram

IO

Save and load a chronogram

cg_save()
Save a chronogram
cg_load()
Load a chronogram

Example datasets

smallstudy
Small study
built_smallstudy
Small study: pre-built chronogram
pitch_chronogram
PITCH study: pre-built chronogram

Plots

Visualise chronogram using ggplot2

cg_plot()
cg_plot
cg_plot_meta()
cg_plot_meta

chronogram class

S3 constructor, helper and validator functions

chronogram()
Build a chronogram, from a chronogram_skeleton and metadata
chronogram_skeleton()
Build a chronogram skeleton, a two column index of IDs and calendar dates, a scaffold for a chronogram
new_grouped_chronogram()
New grouped chronogram
new_tbl2chronogram()
new_tbl2chronogram
check_experiment()
check ExperimentalData
check_metadata()
check metadata
validate_chronogram()
Validate chronogram
validate_chronogram_skeleton()
validate chronogram skeleton

Extending dplyr, tibble

dplyr_row_slice(<cg_tbl>) dplyr_col_modify(<cg_tbl>) dplyr_reconstruct(<cg_tbl>) dplyr_row_slice(<grouped_cg_df>) group_data_trim() dplyr_col_modify(<grouped_cg_df>) dplyr_reconstruct(<grouped_cg_df>)
Extending dplyr to chronogram
group_by(<cg_tbl>) ungroup(<grouped_cg_df>)
group-by & ungroup-by chronogram
glimpse(<cg_tbl>)
Glimpse S3 method for chronogram objects (class cg_tbl)
glimpse(<grouped_cg_df>)
Glimpse S3 method for grouped chronogram objects (class grouped_cg_df)
glimpse_experiment_data()
Glimpse S3 method for experiment data from chronogram objects (class cg_tbl)
glimpse_metadata()
Glimpse S3 method for metadata from chronogram objects (class cg_tbl)