@@ -148,13 +148,13 @@ reformulate_lhs <- function(x) {
148148# Reformulate an expression as the RHS of a model formula
149149#
150150# @param x The expression to reformulate
151- # @param subbars A logical specifying whether to call lme4 ::subbars
151+ # @param subbars A logical specifying whether to call reformulas ::subbars
152152# on the result
153153# @return A model formula
154154reformulate_rhs <- function (x , subbars = FALSE ) {
155155 fm <- formula(substitute(~ RHS , list (RHS = x )))
156156 if (subbars ) {
157- lme4 :: subbars(fm )
157+ reformulas :: subbars(fm )
158158 } else {
159159 fm
160160 }
@@ -579,7 +579,7 @@ rename_t_and_cauchy <- function(prior_stuff, has) {
579579# has_aux: logical specifying whether the glmer submodel
580580# requires an auxiliary parameter.
581581handle_y_mod <- function (formula , data , family ) {
582- mf <- stats :: model.frame(lme4 :: subbars(formula ), data )
582+ mf <- stats :: model.frame(reformulas :: subbars(formula ), data )
583583 if (! length(formula ) == 3L )
584584 stop2(" An outcome variable must be specified." )
585585
@@ -647,7 +647,7 @@ make_y_for_stan <- function(formula, model_frame, family) {
647647# N,K: number of rows (observations) and columns (predictors) in the
648648# fixed effects model matrix
649649make_x_for_stan <- function (formula , model_frame ) {
650- x_form <- lme4 :: nobars(formula )
650+ x_form <- reformulas :: nobars(formula )
651651 x <- model.matrix(x_form , model_frame )
652652 has_intercept <- check_for_intercept(x , logical = TRUE )
653653 xtemp <- drop_intercept(x )
@@ -680,7 +680,7 @@ make_x_for_stan <- function(formula, model_frame) {
680680# grouping factor
681681# ngrps: a vector with the number of groups for each grouping factor
682682make_z_for_stan <- function (formula , model_frame ) {
683- bars <- lme4 :: findbars(formula )
683+ bars <- reformulas :: findbars(formula )
684684 if (length(bars ) > 2L )
685685 stop2(" A maximum of 2 grouping factors are allowed." )
686686 z_parts <- lapply(bars , split_at_bars )
@@ -816,7 +816,7 @@ append_mvmer_famlink <- function(family, is_bernoulli = FALSE) {
816816# - the formula part (ie. the formula on the LHS of "|"), and
817817# - the name of the grouping factor (ie. the variable on the RHS of "|")
818818#
819- # @param x Random effects part of a model formula, as returned by lme4 ::findbars
819+ # @param x Random effects part of a model formula, as returned by reformulas ::findbars
820820# @return A named list with the following elements:
821821# re_form: a formula specifying the random effects structure
822822# group_var: the name of the grouping factor
@@ -919,13 +919,13 @@ check_id_list <- function(id_var, y_flist) {
919919#
920920# @param terms The existing model frame terms object
921921# @param formula The formula that was used to build the model frame
922- # (but prior to having called lme4 ::subbars on it!)
922+ # (but prior to having called reformulas ::subbars on it!)
923923# @param data The data frame that was used to build the model frame
924924# @return A terms object with predvars.fixed and predvars.random as
925925# additional attributes
926926append_predvars_attribute <- function (terms , formula , data ) {
927- fe_form <- lme4 :: nobars(formula )
928- re_form <- lme4 :: subbars(justRE(formula , response = TRUE ))
927+ fe_form <- reformulas :: nobars(formula )
928+ re_form <- reformulas :: subbars(justRE(formula , response = TRUE ))
929929 fe_frame <- stats :: model.frame(fe_form , data )
930930 re_frame <- stats :: model.frame(re_form , data )
931931 fe_terms <- attr(fe_frame , " terms" )
@@ -1587,7 +1587,7 @@ parse_assoc_data <- function(x, user_x) {
15871587 if (identical(length(fm ), 3L ))
15881588 stop(paste0(" Formula specified for '" , x , " ' association structure should not " ,
15891589 " include a response." ), call. = FALSE )
1590- if (length(lme4 :: findbars(fm )))
1590+ if (length(reformulas :: findbars(fm )))
15911591 stop(paste0(" Formula specified for '" , x , " ' association structure should only " ,
15921592 " include fixed effects." ), call. = FALSE )
15931593 if (fm [[2L ]] == 1 )
0 commit comments