inst/doc/seir.R

## ----echo=FALSE---------------------------------------------------------------
library(knitr)
opts_chunk$set(size='footnotesize')

## -----------------------------------------------------------------------------
matrix(c(0, 20, 70, 
    84, 90, 3, 2.6, 1.9, 1, 0.5), ncol = 2)

## ----echo=FALSE, fig.height=4.5-----------------------------------------------
library(SEIR) # we first load the package
s <- solveSEIR()
plot(s, "rzero")

## ----echo=FALSE, fig.height=4.5-----------------------------------------------
s <- solveSEIR( type="C")
plot(s, "rzero")

## -----------------------------------------------------------------------------
Sol <- solveSEIR()
Sol

## -----------------------------------------------------------------------------
names(Sol)

## -----------------------------------------------------------------------------
Sol[c(10,50,100,150)]  

## ----fig.height=5-------------------------------------------------------------
plot(Sol, "acase")

## ----fig.height=5-------------------------------------------------------------
plot(Sol, "tcase")

## ----fig.height=5-------------------------------------------------------------
plot(Sol, "both")

## ----fig.height=5-------------------------------------------------------------
plot(Sol, "rzero")

## ----fig.height=5-------------------------------------------------------------
plot(Sol, "E")

## ----fig.height=5-------------------------------------------------------------
plot(Sol, "I")

## ----fig.height=5-------------------------------------------------------------
zbreaks <- matrix(c(0,  20,  70,  84,  90, 120, 240, 360,
                    3, 2.6,  1.9, 1,  0.5, 0.5, 1.75, 0.5), ncol = 2)
Sol <- solveSEIR(T=450, r0=zbreaks)
plot(Sol, "rzero")

## ----fig.height=5-------------------------------------------------------------
plot(Sol, "acase")

## ----fig.height=5-------------------------------------------------------------
plot(Sol, "both")

Try the SEIR package in your browser

Any scripts or data that you put into this service are public.

SEIR documentation built on April 14, 2020, 3:09 p.m.