R: Create a skeleton for a new R package with Stan programs

rstan_package_skeleton {rstantools} | R Documentation

## Create a skeleton for a new R package with Stan programs

### Description

This function is very similar to `package.skeleton` but is designed for source packages that want to include Stan Programs that can be built into binary versions.

### Usage

    rstan_package_skeleton(name = "anRpackage", list = character(),
      environment = .GlobalEnv, path = ".", force = FALSE,
      code_files = character(), stan_files = character(), travis = TRUE)

### Arguments

`name, list, environment, path, force, code_files` | Same as in `package.skeleton`.
`stan_files` | A character vector with paths to `.stan` files to include in the package. Otherwise similar to `code_files`.
`travis` | Should a `.travis.yml` file be added to the package directory? Defaults to `TRUE`.

### Details

This function first calls `package.skeleton` and then adds the files listed in `stan_files` to an exec directory. Finally, it downloads several files from the rstanarm package's GitHub repository to facilitate building the resulting package. Note that rstanarm is licensed under the GPL >= 3, so package builders who do not want to be governed by that license should not use the downloaded files that contain R code. Otherwise, it may be worth considering whether it would be easier to include your `.stan` programs and supporting R code in the rstanarm package.

After running `rstan_package_skeleton` see the `Read-and-delete-me` file created in the package directory. The content in that file contains the content of the `Read-and-delete-me` file created by `package.skeleton` plus additional Stan-specific instructions.

### See Also

The rstanarm repository on GitHub (https://github.com/stan-dev/rstanarm) and a useR2016 presentation (https://channel9.msdn.com/Events/useR-international-R-User-conferences/useR-International-R-User-2017-Conference/How-to-Use-RStan-to-Estimate-Models-in-External-R-Packages).

- The guidelines for developers of R packages interfacing with Stan, a copy of which can be found in the package vignettes. See `browseVignettes("rstantools")` or `vignette(package = "rstantools")`. The document is also available online at the rstantools page on the CRAN website.

- The Stan Forums and the rstantools issue tracker for assistance if you have trouble setting up your package.

[Package rstantools version 1.4.0 Index]