diff --git a/inst/ba2_full.rds b/inst/ba2_full.rds index 6937cfd..0cc420b 100644 --- a/inst/ba2_full.rds +++ b/inst/ba2_full.rds @@ -1,4 +1,4 @@ -pid,date,last_exp_date,titre_type,value,censored,infection_history,last_vax_type,exp_num +pid,day,last_exp_day,titre_type,value,censored,infection_history,last_vax_type,exp_num 1,2022-01-31,2021-12-26,Delta,2560,1,Infection naive,BNT162b2,5 1,2022-01-31,2021-12-26,BA.1,1841.32228,0,Infection naive,BNT162b2,5 1,2022-01-31,2021-12-26,BA.2,786.8526775,0,Infection naive,BNT162b2,5 diff --git a/inst/xbb_full.rds b/inst/xbb_full.rds index 188d6bb..c6c0fc3 100644 --- a/inst/xbb_full.rds +++ b/inst/xbb_full.rds @@ -1,4 +1,4 @@ -pid,date,last_exp_date,titre_type,value,censored,infection_history,last_vax_type,exp_num +pid,day,last_exp_day,titre_type,value,censored,infection_history,last_vax_type,exp_num 1,2022-12-07,2022-11-16,BA.5,2560,1,Previously infected (Omicron),BNT162b2+BA1,7 1,2022-12-07,2022-11-16,BQ.1.1,2560,1,Previously infected (Omicron),BNT162b2+BA1,7 1,2022-12-07,2022-11-16,XBB,2560,1,Previously infected (Omicron),BNT162b2+BA1,7 diff --git a/vignettes/biokinetics.Rmd b/vignettes/biokinetics.Rmd index 290e115..b5679eb 100644 --- a/vignettes/biokinetics.Rmd +++ b/vignettes/biokinetics.Rmd @@ -71,10 +71,10 @@ plot_data[, titre_type := forcats::fct_relevel( c("Ancestral", "Alpha", "Delta"))] ggplot(data = plot_data) + - geom_line(aes(x = t, + geom_line(aes(x = time_since_last_exp, y = me, colour = titre_type)) + - geom_ribbon(aes(x = t, + geom_ribbon(aes(x = time_since_last_exp, ymin = lo, ymax = hi, fill = titre_type), alpha = 0.65) + @@ -173,8 +173,8 @@ res$wave <- "Delta" dat$wave <- "Delta" plot_data <- merge( res, dat[, .( - min_date = min(date), max_date = max(date)), by = wave])[ - , .SD[calendar_date >= min_date & calendar_date <= date_ba2], by = wave] + min_date = min(day), max_date = max(day)), by = wave])[ + , .SD[calendar_day >= min_date & calendar_day <= date_ba2], by = wave] plot_data[, titre_type := forcats::fct_relevel( titre_type, @@ -182,14 +182,14 @@ plot_data[, titre_type := forcats::fct_relevel( ggplot() + geom_line( data = plot_data, - aes(x = calendar_date, + aes(x = calendar_day, y = me, group = interaction(titre_type, wave), colour = titre_type), alpha = 0.2) + geom_ribbon( data = plot_data, - aes(x = calendar_date, + aes(x = calendar_day, ymin = lo, ymax = hi, group = interaction(titre_type, wave) @@ -205,10 +205,10 @@ ggplot() + geom_line( values = custom_palette) + scale_x_date( date_labels = "%b %Y", - limits = c(min(dat$date), date_ba2)) + + limits = c(min(dat$day), date_ba2)) + geom_smooth( data = plot_data, - aes(x = calendar_date, + aes(x = calendar_day, y = me, fill = titre_type, colour = titre_type, @@ -236,7 +236,7 @@ combined_data <- data.table::data.table(data.table::rbindlist(results_list)) Plotting the median values: ```{r} -plot_data <- combined_data[calendar_date == date_delta] +plot_data <- combined_data[calendar_day == date_delta] plot_data <- plot_data[, titre_type := forcats::fct_relevel( titre_type, c("Ancestral", "Alpha", "Delta"))]