Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unsupported array syntax formatting example #1008

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading