Skip to content

Commit 350bedc

Browse files
committed
minor cleaning
1 parent 1d2dbd4 commit 350bedc

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

R/brmsformula.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#' of the \code{exgaussian} family);
3030
#' \code{zi} (zero-inflation probability);
3131
#' \code{hu} (hurdle probability);
32+
#' \code{disc} (discrimination) for ordinal models;
3233
#' \code{bs}, \code{ndt}, and \code{bias} (boundary separation,
3334
#' non-decision time, and initial bias of the \code{wiener}
3435
#' diffusion model).
@@ -402,12 +403,12 @@ brmsformula <- function(formula, ..., nonlinear = NULL) {
402403
attr(dots[[i]], "par") <- NULL
403404
}
404405
if (any(!nzchar(names(dots)))) {
405-
stop("'brmsformula' requires named arguments.", call. = FALSE)
406+
stop2("'brmsformula' requires named arguments.")
406407
}
407408
invalid_names <- setdiff(names(dots), auxpars())
408409
if (length(invalid_names)) {
409-
stop("The following argument names were invalid: ",
410-
paste(invalid_names, collapse = ", "), call. = FALSE)
410+
stop2("The following argument names were invalid: ",
411+
paste(invalid_names, collapse = ", "))
411412
}
412413
# add attributes to formula
413414
if (is.logical(attr(formula, "nonlinear"))) {

R/stan-helpers.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,9 @@ stan_ordinal <- function(family, prior = brmsprior(),
485485
sign <- ifelse(fam %in% c("cumulative", "sratio"), " - ", " + ")
486486
ptl <- ifelse(cs, paste0(sign, "etacs[k]"), "")
487487
if (sign == " - ") {
488-
out <- paste0("thres[",k,"]", ptl, " - eta")
488+
out <- paste0("thres[", k, "]", ptl, " - eta")
489489
} else {
490-
out <- paste0("eta", ptl, " - thres[",k,"]")
490+
out <- paste0("eta", ptl, " - thres[", k, "]")
491491
}
492492
paste0("disc * (", out, ")")
493493
}
@@ -541,8 +541,8 @@ stan_ordinal <- function(family, prior = brmsprior(),
541541
out$fun <- paste0(out$fun,
542542
" p[1] = ", ilink, "(", th(1), "); \n",
543543
" for (k in 2:(ncat - 1)) { \n",
544-
" p[k] = ", ilink, "(", th("k"), ") - ",
545-
ilink, "(", th("k - 1"), "); \n",
544+
" p[k] = ", ilink, "(", th("k"), ") - \n",
545+
" ", ilink, "(", th("k - 1"), "); \n",
546546
" } \n",
547547
" p[ncat] = 1 - ",ilink, "(", th("ncat - 1"), "); \n")
548548
} else if (family %in% c("sratio", "cratio")) {

man/brmsformula.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)