Learn R Programming

reformulas

reformulas (random effects formulas) is a utility package for processing "lme4-style" random effects formulas in R (i.e., formulas where the random effects are included in the form (f|g) as components of an overall model formula, where f represents a sub-formula for the varying effects and g represents a sub-formula for the grouping variable(s).

The package contains functions like findbars (extract terms containing |, i.e. random-effects terms), nobars (drop terms containing bars from a formula), etc.. The goal of reformulas is to be used upstream of lme4 and glmmTMB (and possibly other packages) as a unified toolkit for processing formulas.

Copy Link

Version

Install

install.packages('reformulas')

Monthly Downloads

406,841

Version

0.4.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Ben Bolker

Last Published

April 30th, 2025

Functions in reformulas (0.4.1)

sub_specials

Substitute safe chars (+) for specials (for use in model.frame) (Generalized from lme4's subbars function.)
mkReTrms

Create list of structures needed for models with random effects
findReTrmClasses

list of specials -- taken from enum.R
anySpecial

Detect whether there are any 'specials' in a formula term
nobars

Omit terms separated by vertical bars in a formula
RHSForm

extract right-hand side of a formula
no_specials

Drop 'specials' from a formula
expandGrpVar

apply
isNested

Is f1 nested within f2?
splitForm

Split formula containing special random effect terms
expandDoubleVert

expand double-bar RE notation by splitting
expandDoubleVerts

Expand terms with '||' notation into separate '|' terms
subbars

"Substitute bars"