isNewMerMod: Test if a 'merMod' Object Has Current Representation

isNewMerModR Documentation

Test if a ‘merMod’ Object Has Current Representation

Description

isNewMerMod tests if a merMod object has the latest representation (in other words, if the object could have been generated using the current version of lme4). The representation of a merMod object was last changed in lme4 version 2.0-0.

forceNewMerMod updates a merMod object so that it has the latest representation. It is useful in code that might handle objects generated by old versions of lme4.

anyStructured tests if a merMod object specifies random effects with structured covariance matrices.

Usage

isNewMerMod(object)
forceNewMerMod(object, reference = object)
anyStructured(object)

Arguments

object, reference

merMod objects.

Value

isNewMerMod and anyStructured return TRUE or FALSE.

forceNewMerMod returns the argument if it is “current” and a modified copy of the argument otherwise.

See Also

Virtual class Covariance.

Examples

fm1 <- lmer(Reaction ~ Days +   us(Days | Subject), sleepstudy)
fm2 <- lmer(Reaction ~ Days + diag(Days | Subject), sleepstudy)
stopifnot(isNewMerMod(fm1), identical(fm1, forceNewMerMod(fm1)),
          !anyStructured(fm1), anyStructured(fm2))


lme4 documentation built on March 6, 2026, 1:07 a.m.