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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Nov 16 23:44:19 CET 2011


Author: dmbates
Date: 2011-11-16 23:44:18 +0100 (Wed, 16 Nov 2011)
New Revision: 1451

Modified:
   pkg/lme4Eigen/R/lmer.R
Log:
Clean up some functions and methods that were causing problems with the tests.


Modified: pkg/lme4Eigen/R/lmer.R
===================================================================
--- pkg/lme4Eigen/R/lmer.R	2011-11-16 22:43:34 UTC (rev 1450)
+++ pkg/lme4Eigen/R/lmer.R	2011-11-16 22:44:18 UTC (rev 1451)
@@ -253,7 +253,7 @@
     }
     rho <- new.env()
     rho$y <- y
-    n <- nrow(fr)
+    N <- n <- nrow(fr)
     if (!is.null(nlenv)) {
         stopifnot(is.language(nlmod),
                   is.environment(nlenv),
@@ -263,6 +263,7 @@
                   mode(gr) == "numeric",
                   nrow(gr) == n,
                   !is.null(pnames <- colnames(gr)))
+        N <- length(gr)
     }
     if (!is.null(offset <- model.offset(fr))) {
         if (length(offset) == 1L) offset <- rep.int(offset, N)
@@ -768,9 +769,9 @@
 
 	if (postVar) {
             .NotYetUsed("postVar=TRUE")## FIXME
-	    vv <- .Call(reTrmsCondVar, re, sigma(object))
-	    for (i in seq_along(ans))
-		attr(ans[[i]], "postVar") <- vv[[i]]
+	    ## vv <- .Call(reTrmsCondVar, re, sigma(object))
+	    ## for (i in seq_along(ans))
+	    ##     attr(ans[[i]], "postVar") <- vv[[i]]
 	}
 	if (drop)
 	    ans <- lapply(ans, function(el)
@@ -795,7 +796,7 @@
 	      dc$cmp[[ifelse(dd[["REML"]], "sigmaREML", "sigmaML")]] else 1.
       })
 
-model.matrix.merMod <- function(object, ...) object at X
+model.matrix.merMod <- function(object, ...) object at pp$X
 
 terms.merMod <- function(x, ...) attr(x at frame, "terms")
 
@@ -1082,13 +1083,13 @@
 
 vcov.summary.mer <- function(object, correlation = TRUE, ...)
 {
-    if(!is.null(object$vcov))
-	vcov
-    else if(!is.null(PP <- object$pp))
-	mkVcov(object$sigma, RX = , nmsX = colnames(FE at X),
-	       correlation=correlation, ...)
-    else stop("Both 'vcov' and 'fe' components are missing.  You need\n",
-	      "at least one TRUE in summary(..,	 varcov = *, keep.X = *)")
+    if(is.null(object$vcov)) stop("logic error in summary of merMod object")
+    return(object$vcov)
+    ## if(!is.null(PP <- object$pp))
+    ##     mkVcov(object$sigma, RX = , nmsX = colnames(FE at X),
+    ##            correlation=correlation, ...)
+    ## else stop("Both 'vcov' and 'fe' components are missing.  You need\n",
+    ##           "at least one TRUE in summary(..,	 varcov = *, keep.X = *)")
 }
 
 mkVarCorr <- function(sc, cnms, nc, theta, nms) {



More information about the Lme4-commits mailing list