Skip to content

Commit bce024a

Browse files
committed
Fixed error in the plotSero function
1 parent 4610612 commit bce024a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

R/sanity.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ plotSero <- function(seroModel, N_max = 100){
99

1010
if (N > N_max) {
1111
sero_plot <- seroModel$data$raw_sero %>% filter(id <= N_max) %>% mutate(id = factor(id, levels = unique(id)))
12+
N_plot <- N_max
1213
} else {
1314
sero_plot <- seroModel$data$raw_sero %>% mutate(id = factor(id, levels = unique(id)))
15+
N_plot <- N
1416
}
1517

1618
T <- sero_plot %>% pull(time) %>% max
@@ -26,7 +28,7 @@ plotSero <- function(seroModel, N_max = 100){
2628
geom_point(aes(x = time, y = id), shape = "|", size = 2.5) +
2729
# geom_point(data = epi_times_sims, aes(x = t, y = i, color = exp_type) , shape = 4)
2830
labs(x = "Time in study (days)", y = "Id of individual", color = "Exposure type") +
29-
geom_hline(yintercept = seq(0.5, N + 0.5, 1), color = "gray90") +
31+
geom_hline(yintercept = seq(0.5, N_plot + 0.5, 1), color = "gray90") +
3032
theme(panel.grid.major.y = element_blank()) + theme_bw()
3133
}
3234

0 commit comments

Comments
 (0)