Skip to content

Commit

Permalink
Merge pull request #1008 from stan-dev/array-example
Browse files Browse the repository at this point in the history
Remove unsupported array syntax formatting example
  • Loading branch information
jgabry authored Jul 11, 2024
2 parents 30fdd51 + 125f518 commit 487009b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 42 deletions.
28 changes: 7 additions & 21 deletions R/model.R
Original file line number Diff line number Diff line change
Expand Up @@ -969,26 +969,6 @@ CmdStanModel$set("public", name = "check_syntax", value = check_syntax)
#' @examples
#' \dontrun{
#'
#' # Example of fixing old syntax
#' # real x[2] --> array[2] real x;
#' file <- write_stan_file("
#' parameters {
#' real x[2];
#' }
#' model {
#' x ~ std_normal();
#' }
#' ")
#'
#' # set compile=FALSE then call format to fix old syntax
#' mod <- cmdstan_model(file, compile = FALSE)
#' mod$format(canonicalize = list("deprecations"))
#'
#' # overwrite the original file instead of just printing it
#' mod$format(canonicalize = list("deprecations"), overwrite_file = TRUE)
#' mod$compile()
#'
#'
#' # Example of removing unnecessary whitespace
#' file <- write_stan_file("
#' data {
Expand All @@ -1003,8 +983,14 @@ CmdStanModel$set("public", name = "check_syntax", value = check_syntax)
#' poisson_lpmf(y | lambda);
#' }
#' ")
#'
#' # set compile=FALSE then call format to fix old syntax
#' mod <- cmdstan_model(file, compile = FALSE)
#' mod$format(canonicalize = TRUE)
#' mod$format(canonicalize = list("deprecations"))
#'
#' # overwrite the original file instead of just printing it
#' mod$format(canonicalize = list("deprecations"), overwrite_file = TRUE)
#' mod$compile()
#' }
#'
format <- function(overwrite_file = FALSE,
Expand Down
28 changes: 7 additions & 21 deletions man/model-method-format.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 487009b

Please sign in to comment.