Create dataframe of simulation results
as.data.frame.sdbuildR_sim.Rd
Convert simulation results to a dataframe. The first column is time, followed by all stocks, and then all other auxiliary and flow variables.
Usage
# S3 method for class 'sdbuildR_sim'
as.data.frame(x, row.names = NULL, optional = FALSE, direction = "long", ...)
See also
Other build:
as.data.frame.sdbuildR_xmile()
,
build()
,
debugger()
,
find_dependencies()
,
get_build_code()
,
header()
,
macro()
,
plot.sdbuildR_xmile()
,
print.summary.sdbuildR_xmile()
,
summary.sdbuildR_xmile()
,
xmile()
Examples
sfm <- xmile("SIR")
sim <- simulate(sfm)
head(as.data.frame(sim))
#> time variable value
#> 1 0.00 Infected 1.000000
#> 2 0.01 Infected 1.015000
#> 3 0.02 Infected 1.030225
#> 4 0.03 Infected 1.045678
#> 5 0.04 Infected 1.061363
#> 6 0.05 Infected 1.077283