r <- seq(0, 1, 0.02)
breaks <- seq(0, 20, 1)
probs <- diff(pgamma(breaks, shape = 1, scale = 2.5))
plot(r, R0(r, breaks, probs), las = 1,
xlab = "initial exponential growth rate",
ylab = "basic reproduction number")
Run the code above in your browser using DataLab