collect_simulations: Group stansim objects into a collection

Description Usage Arguments Value Examples

View source: R/collect.R

Description

collect_simulations() groups together an arbitrary number of objects with class stansim_simulation or stansim_collection into a single stansim_collection object. Allows for multiple simulations to be stored, saved, analysed and managed in a single object.

Usage

1
collect_simulations(collection_name, object, ...)

Arguments

collection_name

A name attached to the stansim_collection object to help identify it. It is strongly recommended that an informative and unique name is assigned.

object

An object of class stansim_simulation or stansim_collection. Must be provided.

...

Any further stansim_simulation or stansim_collection objects to be grouped into a single stansim_collection object.

Value

An S3 object of class stansim_simulation recording relevant simulation data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# group together stansim_simulation objects
collection_basic <- collect_simulations("Linear Regression Study", simulation1,
                            simulation2)

# group together stansim_simulations and stansim_collections
collection_extended <- collect_simulations("Extended Lin Reg Study", collection_basic,
                               simulation3)

# group together multiple stansim_collections
merged_collections <- collect_simulations("merged collections", collection_extended,
                              collection_additional)

## End(Not run)

Ewan-Keith/rstansim documentation built on May 6, 2019, 4:08 p.m.