[Lme4-commits] r1459 - pkg/lme4Eigen/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Nov 28 23:06:28 CET 2011


Author: dmbates
Date: 2011-11-28 23:06:27 +0100 (Mon, 28 Nov 2011)
New Revision: 1459

Modified:
   pkg/lme4Eigen/R/lmer.R
Log:
Use the value of emptyenv(), not the funtion itself.  Add ... to refitML generic and method


Modified: pkg/lme4Eigen/R/lmer.R
===================================================================
--- pkg/lme4Eigen/R/lmer.R	2011-11-28 16:18:02 UTC (rev 1458)
+++ pkg/lme4Eigen/R/lmer.R	2011-11-28 22:06:27 UTC (rev 1459)
@@ -53,7 +53,7 @@
     resp <- mkRespMod2(fr)
     if (REML) resp$reml <- p
 
-    devfun <- mkdevfun(pp, resp, emptyenv)
+    devfun <- mkdevfun(pp, resp, emptyenv())
     if (devFunOnly) return(devfun)
 					# one evaluation to ensure all values are set
     opt <- list(fval=devfun(reTrms$theta))
@@ -85,6 +85,7 @@
 }## { lmer }
 
 mkdevfun <- function(pp, resp, rho, nAGQ=1L) {
+    stopifnot(is.environment(rho), is(resp, "lmResp"))
     if (is(resp, "lmerResp"))
 	return(function(theta) .Call(lmer_Deviance, pp$ptr, resp$ptr, theta))
     if (is(resp, "glmResp")) {
@@ -1045,9 +1046,9 @@
 isREML <- function(x) UseMethod("isREML")
 isREML.merMod <- function(x) as.logical(x at devcomp$dims["REML"])
 
-refitML <- function(x) UseMethod("refitML")
+refitML <- function(x, ...) UseMethod("refitML")
 ## Can't change x in the call to this function.
-refitML.merMod <- function (x) {
+refitML.merMod <- function (x, ...) {
     if (!isREML(x)) return(x)
     stopifnot(is(rr <- x at resp, "lmerResp"))
     resp <- new(class(rr), y=rr$y)



More information about the Lme4-commits mailing list