From efc75bb0d4f3b709435360e356342b75afe31f63 Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Fri, 17 Jul 2026 14:09:07 -0700 Subject: [PATCH 1/4] Bumped Roxygen to 8.0.0 --- DESCRIPTION | 2 +- man/rstantools-package.Rd | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index af1d142..ab7a148 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -56,6 +56,6 @@ Suggests: roxygen2 (>= 6.0.1), rmarkdown, rstudioapi -RoxygenNote: 7.3.3 VignetteBuilder: knitr Roxygen: list(markdown = TRUE) +Config/roxygen2/version: 8.0.0 diff --git a/man/rstantools-package.Rd b/man/rstantools-package.Rd index 327d82d..277fe3b 100644 --- a/man/rstantools-package.Rd +++ b/man/rstantools-package.Rd @@ -44,6 +44,7 @@ Useful links: Authors: \itemize{ + \item Jonah Gabry \email{jgabry@gmail.com} \item Ben Goodrich \email{benjamin.goodrich@columbia.edu} \item Martin Lysy \email{mlysy@uwaterloo.ca} \item Andrew Johnson @@ -54,6 +55,7 @@ Other contributors: \item Hamada S. Badr [contributor] \item Marco Colombo [contributor] \item Stefan Siegert [contributor] + \item Visruth Srimath Kandali [contributor] \item Trustees of Columbia University [copyright holder] } From ff70330d4681be9a5dfb8713262a990c706e71ec Mon Sep 17 00:00:00 2001 From: VisruthSK Date: Fri, 17 Jul 2026 14:45:42 -0700 Subject: [PATCH 2/4] Fixed vignette --- vignettes/minimal-rstan-package.Rmd | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/vignettes/minimal-rstan-package.Rmd b/vignettes/minimal-rstan-package.Rmd index e0fa99e..4bab8e0 100644 --- a/vignettes/minimal-rstan-package.Rmd +++ b/vignettes/minimal-rstan-package.Rmd @@ -157,7 +157,6 @@ model { } " writeLines(stan_prog, con = file.path(PATH, "inst", "stan", "lm.stan")) -rstan_config(PATH) ``` The `inst/stan` subdirectory can contain additional Stan programs if @@ -179,7 +178,7 @@ the package functions. The following comment block placed in `lm_stan.R` ensures that the function has a help file and that it is added to the package `NAMESPACE`: -```{r} +```{r, eval=FALSE} # Save this file as `R/lm_stan.R` #' Bayesian linear regression with Stan @@ -244,8 +243,8 @@ roxygen2::roxygenize() ``` ```{r, echo=FALSE, results="hide"} -try(roxygen2::roxygenize(PATH, load_code = rstantools_load_code), silent = TRUE) -roxygen2::roxygenize(PATH) +roxygen2::roxygenize(PATH, load_code = roxygen2::load_source) +rstan_config(PATH) ``` ## Install and use @@ -268,11 +267,8 @@ documentation, you can set `quick=TRUE` to speed up the process, or use After installation, the package can be loaded and used like any other R package: -```{r, eval=FALSE} -library("rstanlm") -``` - ```{r} +library(rstanlm) fit <- lm_stan(y = rnorm(10), x = rnorm(10), # arguments passed to sampling iter = 2000, refresh = 500) From e5f6658c716bdae6097697096d99dde295918a1f Mon Sep 17 00:00:00 2001 From: Visruth Srimath Kandali Date: Mon, 20 Jul 2026 02:35:17 -0700 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Jonah Gabry --- DESCRIPTION | 2 +- vignettes/minimal-rstan-package.Rmd | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ab7a148..644ddcd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -53,7 +53,7 @@ Suggests: knitr, pkgbuild, pkgload, - roxygen2 (>= 6.0.1), + roxygen2 (>= 7.0.0), rmarkdown, rstudioapi VignetteBuilder: knitr diff --git a/vignettes/minimal-rstan-package.Rmd b/vignettes/minimal-rstan-package.Rmd index 4bab8e0..faab8d1 100644 --- a/vignettes/minimal-rstan-package.Rmd +++ b/vignettes/minimal-rstan-package.Rmd @@ -235,11 +235,13 @@ information about the package. With __roxygen__ documentation enabled, we need to generate the documentation for `lm_stan` and update the `NAMESPACE` so the function is exported, i.e., available to users when the package is installed. This can be done with the -function `roxygen2::roxygenize()`, which needs to be called twice initially. +available to users when the package is installed. Load the R source files directly when running `roxygen2::roxygenize()`, then call `rstan_config()` to +generate the Stan C++ code: ```{r, eval = FALSE} try(roxygen2::roxygenize(load_code = rstantools_load_code), silent = TRUE) -roxygen2::roxygenize() +roxygen2::roxygenize(load_code = roxygen2::load_source) +rstantools::rstan_config() ``` ```{r, echo=FALSE, results="hide"} From ee1f097c0323608a7a55f036e88088e246bfb54f Mon Sep 17 00:00:00 2001 From: jgabry Date: Mon, 20 Jul 2026 09:37:58 -0600 Subject: [PATCH 4/4] Try suggesting BH and RcppEigen --- DESCRIPTION | 2 ++ vignettes/minimal-rstan-package.Rmd | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 644ddcd..823dc5f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -48,6 +48,8 @@ SystemRequirements: pandoc Imports: desc, stats, utils, Rcpp (>= 0.12.16), RcppParallel (>= 5.0.1) Suggests: rstan (>= 2.17.2), + BH (>= 1.66.0), + RcppEigen (>= 0.3.3.3.0), usethis (>= 1.5.1), testthat (>= 2.0.0), knitr, diff --git a/vignettes/minimal-rstan-package.Rmd b/vignettes/minimal-rstan-package.Rmd index faab8d1..de7bc4a 100644 --- a/vignettes/minimal-rstan-package.Rmd +++ b/vignettes/minimal-rstan-package.Rmd @@ -234,12 +234,11 @@ information about the package. With __roxygen__ documentation enabled, we need to generate the documentation for `lm_stan` and update the `NAMESPACE` so the function is exported, i.e., -available to users when the package is installed. This can be done with the -available to users when the package is installed. Load the R source files directly when running `roxygen2::roxygenize()`, then call `rstan_config()` to +available to users when the package is installed. Load the R source files +directly when running `roxygen2::roxygenize()`, then call `rstan_config()` to generate the Stan C++ code: ```{r, eval = FALSE} -try(roxygen2::roxygenize(load_code = rstantools_load_code), silent = TRUE) roxygen2::roxygenize(load_code = roxygen2::load_source) rstantools::rstan_config() ```