Rstan_package_skeleton fails


#1

Hello,

in launching rstan_package_skeleton, I get error. Am I missing something?

> library(rstantools)
This is rstantools version 1.4.0
> rstantools::rstan_package_skeleton("anRpackage")
Running package.skeleton ...
Error in utils::package.skeleton(name = "anRpackage") : 
  no R objects specified or available

.

R version 3.3.0 (2016-05-03)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS release 6.4 (Final)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rstantools_1.4.0

loaded via a namespace (and not attached):
[1] tools_3.3.0

Thanks


#2

The error occurs because you must have at least one variable in your environment that will be imported into “data” directory.

This worked

> x=0
> rstantools::rstan_package_skeleton("test")
Running package.skeleton ...
Adding .travis.yml file ...
Creating tools directory ...
Creating src directory ...
Creating directory for .stan files ...
Creating directory for Stan code chunks ...
Creating directory for custom C++ functions ...
Updating R directory ...
Updating DESCRIPTION ...
Updating Read-and-delete-me with Stan-specific notes...
Further steps are described in './test/Read-and-delete-me'.