Skip to content

Commit

Permalink
Remove unsupported array syntax formatting example
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Jul 11, 2024
1 parent 30fdd51 commit 125f518
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 125f518

Please sign in to comment.