Skip to content

Commit 125f518

Browse files
committed
Remove unsupported array syntax formatting example
1 parent 30fdd51 commit 125f518

2 files changed

Lines changed: 14 additions & 42 deletions

File tree

R/model.R

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -969,26 +969,6 @@ CmdStanModel$set("public", name = "check_syntax", value = check_syntax)
969969
#' @examples
970970
#' \dontrun{
971971
#'
972-
#' # Example of fixing old syntax
973-
#' # real x[2] --> array[2] real x;
974-
#' file <- write_stan_file("
975-
#' parameters {
976-
#' real x[2];
977-
#' }
978-
#' model {
979-
#' x ~ std_normal();
980-
#' }
981-
#' ")
982-
#'
983-
#' # set compile=FALSE then call format to fix old syntax
984-
#' mod <- cmdstan_model(file, compile = FALSE)
985-
#' mod$format(canonicalize = list("deprecations"))
986-
#'
987-
#' # overwrite the original file instead of just printing it
988-
#' mod$format(canonicalize = list("deprecations"), overwrite_file = TRUE)
989-
#' mod$compile()
990-
#'
991-
#'
992972
#' # Example of removing unnecessary whitespace
993973
#' file <- write_stan_file("
994974
#' data {
@@ -1003,8 +983,14 @@ CmdStanModel$set("public", name = "check_syntax", value = check_syntax)
1003983
#' poisson_lpmf(y | lambda);
1004984
#' }
1005985
#' ")
986+
#'
987+
#' # set compile=FALSE then call format to fix old syntax
1006988
#' mod <- cmdstan_model(file, compile = FALSE)
1007-
#' mod$format(canonicalize = TRUE)
989+
#' mod$format(canonicalize = list("deprecations"))
990+
#'
991+
#' # overwrite the original file instead of just printing it
992+
#' mod$format(canonicalize = list("deprecations"), overwrite_file = TRUE)
993+
#' mod$compile()
1008994
#' }
1009995
#'
1010996
format <- function(overwrite_file = FALSE,

man/model-method-format.Rd

Lines changed: 7 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)