Applied to an object of type stansim_collection,
extract_time_elapsed() will return the time taken to fit the
models contained within the object a dataframe, subject to the filtering
specified by the function arguments.
# S3 method for stansim_collection extract_time_elapsed(object, sim_names = "all", datasets = "all", chains = "all", stages = "all", elapsed = NULL, ...)
| object | An object of S3 class stansim_collection. |
|---|---|
| sim_names | Either a character vector containing the names of the
|
| datasets | Either a character vector containing the names of datasets
(as provided to the original |
| chains | Either a character vector containing the numbers of the stan model
chains to return, or the string |
| stages | Either a character vector containing the names of model fitting
stages, |
| elapsed | Either a function taking a single numeric argument that
returns a Boolean value, or |
| ... | other arguments not used by this method |
A dataframe containing the specified data.
# NOT RUN { # extract full dataset extract_time_elapsed(simulation) # extract all rows for dataset "data_file-12.rds" extract_time_elapsed(simulation, datasets = "data_file-12.rds") # extract results for chains 1 and 3 extract_time_elapsed(simulation, chains = c(1, 3)) # extract results for only the warmup stage extract_time_elapsed(simulation, stages = "warmup") # extract all elapsed times greater than 60 seconds extract_time_elapsed(simulation, elapsed = function(x) x > 60) # }