Learn R Programming

rstan (version 2.8.2)

rstan.package.skeleton: Create a Skeleton for a New Source 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())

Arguments

name, list, environment, path, force, code_files
Same is in package.skeleton
stan_files
A character vector with paths to .stan files to include in the package. Otherwise similar to code_files.

Value

  • Used for its side-effects

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 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.

See Also

https://github.com/stan-dev/rstanarm/ for an example of how to create a package that contains pre-compilable .stan programs

Examples

Run this code
# See example(package.skeleton)

Run the code above in your browser using DataLab