1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
\name{isNewMerMod}
\alias{isNewMerMod}
\alias{forceNewMerMod}
\alias{anyStructured}
\title{Test if a \sQuote{merMod} Object Has Current Representation}
\description{
\code{isNewMerMod} tests if a \code{\linkS4class{merMod}} object has
the latest representation (in other words, if the object could have
been generated using the current version of \pkg{lme4}). The
representation of a \code{merMod} object was last changed in
\pkg{lme4} version 2.0-0.
\code{forceNewMerMod} updates a \code{\linkS4class{merMod}} object so
that it has the latest representation. It is useful in code that
might handle objects generated by old versions of \pkg{lme4}.
\code{anyStructured} tests if a \code{\linkS4class{merMod}} object
specifies random effects with structured covariance matrices.
}
\usage{
isNewMerMod(object)
forceNewMerMod(object, reference = object)
anyStructured(object)
}
\arguments{
\item{object, reference}{\code{\linkS4class{merMod}} objects.}
}
\value{
\code{isNewMerMod} and \code{anyStructured} return \code{TRUE} or
\code{FALSE}.
\code{forceNewMerMod} returns the argument if it is \dQuote{current}
and a modified copy of the argument otherwise.
}
\seealso{Virtual class \linkS4class{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))
\dontshow{
.fm1 <- fm1
attr(.fm1, "upper") <- attr(.fm1, "reCovs") <- NULL
stopifnot(!isNewMerMod(.fm1), identical(fm1, forceNewMerMod(.fm1)))
rm(.fm1)
}
}
|