Learn R Programming

mizer (version 2.2.0)

idxFinalT: Time index at end of simulation

Description

Time index at end of simulation

Usage

idxFinalT(sim)

Arguments

sim

A MizerSim object

Value

An integer giving the index for extracting the results for the final time step

Examples

Run this code
# NOT RUN {
sim <- project(NS_params, t_max = 12, t_save = 0.5)
idx <- idxFinalT(sim)
idx
# This coincides with
length(getTimes(sim))
# and corresponds to the final time
getTimes(sim)[idx]
# We can use this index to extract the result at the final time
identical(N(sim)[idx, , ], finalN(sim))
identical(NResource(sim)[idx, ], finalNResource(sim))
# }

Run the code above in your browser using DataLab