Skip to contents

Print the last rows of a simulation data frame of a stock-and-flow model. This is a wrapper around tail() that first converts the simulation results to a data frame using as.data.frame().

Usage

# S3 method for class 'simulate_stockflow'
tail(x, n = 6L, ...)

Arguments

x

Output of simulate().

n

Number of rows to print. Defaults to 6.

...

Other arguments passed to as.data.frame.simulate_stockflow().

Value

A data.frame with the last rows of the simulation results.

Examples

sfm <- stockflow("sir")
sim <- simulate(sfm)
tail(sim)
#>       time    variable      value
#> 5998 19.95 susceptible 0.02911698
#> 5999 19.96 susceptible 0.02897038
#> 6000 19.97 susceptible 0.02882466
#> 6001 19.98 susceptible 0.02867981
#> 6002 19.99 susceptible 0.02853584
#> 6003 20.00 susceptible 0.02839274