View source: R/output_nosoiSummary.R
nosoiSummary | R Documentation |
nosoi
simulationThis function provides summary information about the simulation (number of infected hosts, R0, etc.) as a list.
nosoiSummary(object)
## S3 method for class 'nosoiSim'
summary(object, ...)
object |
Output of a nosoi simulation (object of class |
... |
further arguments passed to or from other methods. |
All computed data is provided in a list:
Provides a sublist with number of inactive hosts at the end of the simulation N.inactive
, mean R0 R0.mean
, and R0 distribution R0.dist
. For more details, see getR0
.
data.table
with the count of currently infected (i.e. active) hosts at each time step of the simulation (by state if the simulation was in a discrete structured host population). For more details, see getDynamic
.
data.table
with the cumulative count of infected hosts at each time step of the simulation. For more details, see getCumulative
.
You can directly compute each elements of the list without using the summarise function. See getR0
, getDynamic
and getCumulative
.
t_incub_fct <- function(x){rnorm(x,mean = 5,sd=1)}
p_max_fct <- function(x){rbeta(x,shape1 = 5,shape2=2)}
p_Exit_fct <- function(t){return(0.08)}
proba <- function(t,p_max,t_incub){
if(t <= t_incub){p=0}
if(t >= t_incub){p=p_max}
return(p)
}
time_contact <- function(t){round(rnorm(1, 3, 1), 0)}
test.nosoi <- nosoiSim(type="single", popStructure="none",
length=40,
max.infected=100,
init.individuals=1,
nContact=time_contact,
param.nContact=NA,
pTrans = proba,
param.pTrans = list(p_max=p_max_fct,
t_incub=t_incub_fct),
pExit=p_Exit_fct,
param.pExit=NA)
nosoiSummary(test.nosoi)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.