Skip to content

Problem with lme4 use and installation

3 messages · anord, Charilaos Skiadas, Douglas Bates

#
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
package 'lme4' successfully unpacked and MD5 sums checked
updating HTML package descriptions
Loading required package: Matrix
Loading required package: lattice

Attaching package: 'Matrix'


        The following object(s) are masked from package:stats :

         xtabs
#
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.

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College
On Mar 3, 2008, at 10:33 AM, Andreas Nord wrote:

            
#
On Mon, Mar 3, 2008 at 9:57 AM, Charilaos Skiadas <cskiadas at gmail.com> wrote:
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.