plot.seir <- function(res){
require('ggplot2')
ggplot(data = res, mapping = aes(x = time)) +
geom_line(aes(y = S, colour = "susceptibles ratio"), lwd = 1.2) +
geom_line(aes(y = E, colour = "exposed ratio"), lwd = 1.2) +
geom_line(aes(y = I, colour = "infectious ratio"), lwd = 1.2) +
geom_line(aes(y = R, colour = "recovered ratio"), lwd = 1.2) +
labs(title = "SEIR model" , y = "Proportion of population", x = "Time sequence") +
theme(plot.title = element_text(hjust = 0.5))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.