[R] Problem with lme4 use and installation

Douglas Bates bates at stat.wisc.edu
Mon Mar 3 19:30:46 CET 2008


On Mon, Mar 3, 2008 at 9:57 AM, Charilaos Skiadas <cskiadas at gmail.com> wrote:
> Nothing's wrong. It just means that the package or one of its
>  dependencies, has its own xtabs function, which "hides" the default
>  xtabs function, since it comes first in the search path. So when you
>  next write xtabs(...), it is this new xtabs that is being loaded. If
>  you want to call the original xtabs, you can still do it I think with
>  stats::xtabs(...).
>
>  This is a warning, not an error. It warns you that something you
>  perhaps did not expect has just happened.

Exactly.

The warning actually comes from loading the Matrix package, a package
is required by the lme4 package.  Martin Maechler and I define an
extended xtabs function as an S4 generic in the Matrix package.  This
version allows an optional argument "sparse".  When sparse = TRUE the
new version produces a cross-tabulation in the form of a sparse
matrix.  As you might expect, this is particularly useful for sparse
cross-tabulations.

When sparse = FALSE, the default value, this version reverts to the
xtabs function from the stats package.  Thus the substitution should
be benign except that it will make xtabs run infinitesimally slower
because it requires an extra level of dispatch.  Unless you are making
thousands of calls to xtabs you shouldn't notice this.


>  On Mar 3, 2008, at 10:33 AM, Andreas Nord wrote:
>
>  >
>  > Dear all,
>  >
>  > I've been trying to install the lme4 package from
>  > http://r-forge.r-project.org/projects/lme4/. However, when wanting
>  > to load
>  > the package, I get an message saying that "x-tabs" are masked (see
>  > pasted
>  > code). Can anyone point to what has gone wrong?
>  >
>  > Kind regards,
>  > Andreas Nord
>  > Sweden
>  >
>  >> utils:::menuInstallLocal()
>  > package 'lme4' successfully unpacked and MD5 sums checked
>  > updating HTML package descriptions
>  >> library(lme4)
>  > Loading required package: Matrix
>  > Loading required package: lattice
>  >
>  > Attaching package: 'Matrix'
>  >
>  >
>  >         The following object(s) are masked from package:stats :
>  >
>  >          xtabs
>  >
>  >>
>  > --
>  > View this message in context: http://www.nabble.com/Problem-with-
>  > lme4-use-and-installation-tp15806404p15806404.html
>  > Sent from the R help mailing list archive at Nabble.com.
>
>  ______________________________________________
>  R-help at r-project.org mailing list
>  https://stat.ethz.ch/mailman/listinfo/r-help
>  PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>  and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list