Skip to content

Commit

Permalink
allow reOnly to *not* split ||
Browse files Browse the repository at this point in the history
  • Loading branch information
bbolker committed Jun 5, 2024
1 parent 3b8e196 commit 200bd91
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
TODO.md
^\.github$
Makefile
10 changes: 7 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,19 @@ sumTerms <- function(termList) {
#' @param f a formula
#' @param response include response variable?
#' @param bracket bracket-protect terms?
#' @param doublevert_split (logical) TRUE for lme4 back-compatibility; FALSE to make double vertical bars into \code{diag()} eterms
#' @rdname formfuns
#' @examples
#' reOnly(~ 1 + x + y + (1|f) + (1|g))
#' @export
reOnly <- function(f, response=FALSE,bracket=TRUE) {
reOnly <- function(f, response=FALSE, bracket=TRUE, doublevert_split = TRUE) {
flen <- length(f)
f2 <- f[[2]]
if (bracket)
f <- lapply(findbars(f), makeOp, quote(`(`)) ## bracket-protect terms
if (bracket) {
xdv <- if (doublevert_split) "split" else "diag_special"
fb <- findbars_x(f, expand_doublevert_method = xdv)
f <- lapply(fb, makeOp, quote(`(`)) ## bracket-protect terms
}
f <- sumTerms(f)
if (response && flen==3) {
form <- makeOp(f2, f, quote(`~`))
Expand Down
4 changes: 3 additions & 1 deletion man/formfuns.Rd

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

0 comments on commit 200bd91

Please sign in to comment.