Description Slots Methods Examples
S4 class containing the data and the layout of the infectious disease data
data
:Data Frame with six columns: x, y, E, I, R, D
layout
:Object of class "LBLayout"
T
:A "numeric"
specifying how long the epidemic was observed.
signature(object = "LBExperiment")
: convert
the data.frame of events for each individual to a time order data.frame of
events for the entire Experiment. The information about each
individual is lost. This function is used internally.
signature(object = "LBExperiment")
: shows all slots
of the LBExperiment object.
signature(object = "LBExperiment")
: sets the
Layout.
signature(signature(x="LBExperiment",
y="missing"), function(x, y, type=NULL, options=NULL, ...))
The type
argument should be a formula specifying the
desired type of plot. By providing an additional options
list individual parameters for the plots are provided. Valid
formulae are
state ~ time | position
The number of susceptible, infectious and recovered as a function of time for each unit. Warning: in case there are many units this plot might be rather useless.
state ~ time
shows the total number of susceptible, infectious and recovered (i.e. summed over all units) as a function of time. Individual options are
stacked
boolean whether stacked boxplots or just time-series are shown.
state ~ 1|position
illustrates the three multivariate time
series (susceptible, exposed,
infected) as a "film" with noOfPics
pictures. Individual
options are
chart
Either "pie"
or "bar"
, where
the latter is default.
justInf
if FALSE
pie charts with the number of
S(t),E(t),I(t) are shown, otherwise only the number of infectious is
shown, where the radius shows the proportion.
noOfPics
How many pictures in the animation. If not saved set the "History" attribute of the X11.
PDF
If TRUE
the results are saved in PDF
Files with the base name name
.
name
Base name of the generated PDF Files. The
actual files are then names name
-addstr
-number
.pdf
addstr
This is added to the base name.
individual ~ time
shows all events for each individual
individual ~ time
| positionshow individual histories of each individual aligned to the same time axis
Additional parameters to the underlying plot rountine,
e.g. xlab
, legend=FALSE
, color
, are passed using ...
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | sim.layout <- new( "LBLayout", S0=matrix( c( 13, rep( 14, 7 ) ), ncol=4 ),
E0=matrix( c( 1, rep( 0, 7 ) ), ncol=4 ) )
sim.opts <- new( "LBOptions", seed=2006,
LBmodel=c( "gamma", "gamma", "gamma", FALSE ),
ignoreData=c( FALSE, FALSE, FALSE ),
initBeta =list( init=0.125,
gamma=0.001, delta=0.001 ),
initBetaN=list( init=0.018,
gamma=0.001, delta=0.001 ),
initIncu=list( asis=FALSE, const=FALSE,
g=6.697, g.gamma=0.001, g.delta=0.001,
d=0.84, d.gamma=0.001,d.delta=0.001 ),
initInf=list( 1.772, 0.001, 0.001, 0.123, 0.001, 0.001 ),
initDia=list( 149.126, 0.001, 0.001,
8.737, 0.001, 0.001 ) )
exp <- simulate( sim.opts, layout=sim.layout )
plot(exp,type = state ~ time)
plot(exp,type = state ~ time, options=list(stacked=FALSE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.