## Calculate the attack rate for a specific value of the reproduction number
R02AR(2) # returns the AR for an R0 of 2
## plot the relationship between R0 and attack rate
x <- seq(1.01, 5, 0.01)
plot(x, R02AR(x), type = "l", xlab = "R0", ylab = "Attack rate")
Run the code above in your browser using DataLab