Creates a symmetric matrix containing the time differences (in days) between
all pairs of cases based on their symptom onset dates.
Usage
create_day_diff_matrix(dates)
Arguments
- dates
vector; dates of symptom onset for each case. Can be Date objects
or any format coercible to dates
Value
numeric matrix; symmetric matrix where element [i,j] represents the
number of days between case i and case j (positive if i occurs after j)
Examples
if (FALSE) { # \dontrun{
onset_dates <- as.Date(c("2023-01-01", "2023-01-04", "2023-01-07", "2023-01-10"))
create_day_diff_matrix(onset_dates)
} # }