it takes a long time to load the lme4 package.anyone else encounter this problem?> system.time(library(lme4))佋佖伻侂佇佽佉仾伒伳伋佁伡伃伆侟仯伜Matrix 佋佖伻侂佇佽佉仾伒伳伋佁伡伃伆侟仯伜lattice [1] 19.90 0.30 25.56 NA NA> version_ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status Patched major 2 minor 1.0 year 2005 month 05 day 29 language R OS:windows 2000 2005-06-13 ------ Deparment of Sociology Fudan University Blog:www.sociology.yculblog.com
On Mon, 13 Jun 2005, ronggui wrote:> it takes a long time to load the lme4 package.anyone else encounter this > problem?Yes: ca 10 secs on my machine. Why do you call it a `problem', though?>> system.time(library(lme4)) > ??????????????????Matrix > ??????????????????lattice > [1] 19.90 0.30 25.56 NA NAProfiling this shows that almost all the time is spent on setting up S4 methods: $by.total total.time total.pct self.time self.pct "eval" 10.32 100.0 0.02 0.2 "library" 10.32 100.0 0.00 0.0 "system.time" 10.32 100.0 0.00 0.0 "<Anonymous>" 9.92 96.1 0.00 0.0 "insertMethod" 8.62 83.5 1.86 18.0 "getAllMethods" 8.36 81.0 0.00 0.0 "mergeMethods" 7.94 76.9 0.00 0.0 I am sure the packages' authors are aware of that. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
It is actually the Matrix package that is taking so long, not lme4. It is is extremely large and is required for use with lme4. I think Doug Bates or Duncan Murdoch can confirm Matrix() contains more than 6000 or so lines of code. But, it is not a problem, it just is what it is. -----Original Message----- From: r-help-bounces@stat.math.ethz.ch on behalf of ronggui Sent: Mon 6/13/2005 12:36 AM To: r-help@stat.math.ethz.ch Cc: Subject: [R] slow loading with lme4 it takes a long time to load the lme4 package.anyone else encounter this problem? > system.time(library(lme4)) 载入需要的程辑包:Matrix 载入需要的程辑包:lattice [1] 19.90 0.30 25.56 NA NA > version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status Patched major 2 minor 1.0 year 2005 month 05 day 29 language R OS:windows 2000 2005-06-13 ------ Deparment of Sociology Fudan University Blog:www.sociology.yculblog.com [[alternative HTML version deleted]]
I should have also noted there is a huge efficiency gain when using lme4 over nlme in that the Matrix package introduces faster matrix operations using sparse matrix algorithms. So, while it may take a moment or two longer to load this package, it saves you *significant* time when fitting mixed linear models. So, you might view this as a cost/benefit trade-off, not a problem. -Harold -----Original Message----- From: r-help-bounces@stat.math.ethz.ch on behalf of Doran, Harold Sent: Mon 6/13/2005 5:57 AM To: 0034058@fudan.edu.cn; r-help@stat.math.ethz.ch Cc: Subject: Re: [R] slow loading with lme4 It is actually the Matrix package that is taking so long, not lme4. It is is extremely large and is required for use with lme4. I think Doug Bates or Duncan Murdoch can confirm Matrix() contains more than 6000 or so lines of code. But, it is not a problem, it just is what it is. -----Original Message----- From: r-help-bounces@stat.math.ethz.ch on behalf of ronggui Sent: Mon 6/13/2005 12:36 AM To: r-help@stat.math.ethz.ch Cc: Subject: [R] slow loading with lme4 it takes a long time to load the lme4 package.anyone else encounter this problem? > system.time(library(lme4)) 载入需è¦çš„程辑包:Matrix 载入需è¦çš„程辑包:lattice [1] 19.90 0.30 25.56 NA NA > version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status Patched major 2 minor 1.0 year 2005 month 05 day 29 language R OS:windows 2000 2005-06-13 ------ Deparment of Sociology Fudan University Blog:www.sociology.yculblog.com [[alternative HTML version deleted]] [[alternative HTML version deleted]]
ronggui a 仺仸crit :> it takes a long time to load the lme4 package.anyone else encounter this problem? > > >>system.time(library(lme4)) > > 佋佖伻侂佇佽佉仾伒伳伋佁伡伃伆侟仯伜Matrix > 佋佖伻侂佇佽佉仾伒伳伋佁伡伃伆侟仯伜lattice > [1] 19.90 0.30 25.56 NA NA > > > >>version > > _ > platform i386-pc-mingw32 > arch i386 > os mingw32 > system i386, mingw32 > status Patched > major 2 > minor 1.0 > year 2005 > month 05 > day 29 > language R > > OS:windows 2000 > > > > 2005-06-13 > > ------ > Deparment of Sociology > Fudan University > > Blog:www.sociology.yculblog.com > > > > ------------------------------------------------------------------------ > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.htmlNo. I use either pre-compiled binaries or I install the packages from source (Matrix and lme4). Windows XP + R 2.1.0 unpatched. Best, Renaud -- Dr Renaud Lancelot, v仺仸t仺仸rinaire Projet FSP r仺仸gional 仺仸pidemio v仺仸t仺仸rinaire C/0 Ambassade de France - SCAC BP 834 Antananarivo 101 - Madagascar e-mail: renaud.lancelot at cirad.fr tel.: +261 32 40 165 53 (cell) +261 20 22 665 36 ext. 225 (work) +261 20 22 494 37 (home)
On Mon, 13 Jun 2005, Doran, Harold wrote:> It is actually the Matrix package that is taking so long, not lme4.Not so: lme4 is taking longer than Matrix:> system.time(library(Matrix))[1] 4.17 0.11 4.28 0.00 0.00> system.time(library(lme4))Loading required package: lattice [1] 6.55 0.08 6.64 0.00 0.00 (this is the additional time for lme4, of course).> It is is extremely large and is required for use with lme4. I think Doug > Bates or Duncan Murdoch can confirm Matrix() contains more than 6000 or > so lines of code. But, it is not a problem, it just is what it is.Actually, only 2302 lines of R code. That of itself is no issue at all: package stats has 23000 lines and loads almost instantly: a default R session loads about 65000 lines in well under a second (about 0.4s on the machine whose timings are given above). As I have already replied (with numerical evidence), the issue is handling all the S4 methods which the packages define. The developers have put a lot of effort in loading lots of R code fast, but little optimization has been done on loading S4 methods. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595