Skip to content

Commit

Permalink
update vignette and all data files
Browse files Browse the repository at this point in the history
  • Loading branch information
hillalex committed Oct 7, 2024
1 parent a156add commit d860659
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion inst/ba2_full.rds
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion inst/xbb_full.rds
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 9 additions & 9 deletions vignettes/biokinetics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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) +
Expand Down Expand Up @@ -173,23 +173,23 @@ 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,
c("Ancestral", "Alpha", "Delta"))]
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)
Expand All @@ -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,
Expand Down Expand Up @@ -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"))]
Expand Down

0 comments on commit d860659

Please sign in to comment.