| as.data.frame.sdbuildR_sim | R Documentation |
Convert simulation results to a data.frame.
## S3 method for class 'sdbuildR_sim'
as.data.frame(x, row.names = NULL, optional = FALSE, direction = "long", ...)
x |
Output of simulate(). |
row.names |
NULL or a character vector giving the row names for the data frame. Missing values are not allowed. |
optional |
Ignored parameter. |
direction |
Format of data frame, either "long" (default) or "wide". |
... |
Optional parameters |
A data.frame with simulation results. For direction = "long" (default),
the data frame has three columns: time, variable, and value.
For direction = "wide", the data frame has columns time followed by
one column per variable.
simulate(), xmile()
sfm <- xmile("SIR")
sim <- simulate(sfm)
df <- as.data.frame(sim)
head(df)
# Get results in wide format
df_wide <- as.data.frame(sim, direction = "wide")
head(df_wide)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.