knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

sims

Lifecycle: stable R-CMD-check Codecov License: MIT CRAN status CRAN downloads

sims is an R package to generate datasets from R or JAGS code for use in simulation studies. The datasets are returned as an nlists object and/or saved to file as individual .rds files. Parallelization is implemented using the future package. Progress is reported using the progressr package.

Installation

You can install the released version of sims from CRAN with:

install.packages("sims")

And the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("poissonconsulting/sims")

Demonstration

Simulate Data

By default, sims_simulate() returns the simulated datasets in the form of an nlists object.

library(sims)
set.seed(10)
sims_simulate("a <- runif(1)", nsims = 2L)

If, however, save = TRUE then each nlist object is saved as an .rds file in path.

set.seed(10)
sims_simulate("a <- runif(1)", nsims = 2L, save = TRUE, path = tempdir(), exists = NA)
sims_data_files(tempdir())
sims_data(tempdir())

Information

For more information see the Get Started vignette.

Contribution

Please report any issues.

Pull requests are always welcome.

Code of Conduct

Please note that the sims project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.



poissonconsulting/sims documentation built on Sept. 2, 2024, 11:11 p.m.