[Lme4-commits] r1864 - in pkg/lme4.0: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Sep 23 16:42:10 CEST 2013


Author: mmaechler
Date: 2013-09-23 16:42:09 +0200 (Mon, 23 Sep 2013)
New Revision: 1864

Modified:
   pkg/lme4.0/NAMESPACE
   pkg/lme4.0/R/drop1-etc.R
Log:
cosmetics for CRAN checks -2-

Modified: pkg/lme4.0/NAMESPACE
===================================================================
--- pkg/lme4.0/NAMESPACE	2013-09-23 14:10:52 UTC (rev 1863)
+++ pkg/lme4.0/NAMESPACE	2013-09-23 14:42:09 UTC (rev 1864)
@@ -3,6 +3,8 @@
 import(Matrix)# including update()
 import(lattice)
 
+importFrom("methods", setClass, representation,
+           setMethod, signature, new)
 ## Generics for which we define new methods:
 importFrom("nlme", fixef, ranef, VarCorr)
 importFrom("graphics", plot)

Modified: pkg/lme4.0/R/drop1-etc.R
===================================================================
--- pkg/lme4.0/R/drop1-etc.R	2013-09-23 14:10:52 UTC (rev 1863)
+++ pkg/lme4.0/R/drop1-etc.R	2013-09-23 14:42:09 UTC (rev 1864)
@@ -14,6 +14,11 @@
 ## "Horribly" this is needed for stats::drop.scope() which does not see the S4 terms() method:
 terms.mer <- function(x,...) attr(x at frame,"terms")
 
+## copied from stats:::safe_pchisq
+safe_pchisq <- function (q, df, ...) {
+    df[df <= 0] <- NA
+    pchisq(q = q, df = df, ...)
+}
 
 ## hacked stats:::drop1.default
 ## FIXME: add F test (with specified denom df)?
@@ -61,18 +66,10 @@
         dev <- dev - dev[1L] ; dev[1L] <- NA
         nas <- !is.na(dev)
         P <- dev
-        ## BMB: hack to extract safe_pchisq
-        P[nas] <- stats:::safe_pchisq(dev[nas], dfs[nas], lower.tail = FALSE)
+	P[nas] <- safe_pchisq(dev[nas], dfs[nas], lower.tail = FALSE)
         aod[, c("LRT", "Pr(Chi)")] <- list(dev, P)
     } else if (test == "F") {
         stop("F test STUB -- unfinished maybe forever")
-        dev <- ans[, 2L] - k*ans[, 1L]
-        dev <- dev - dev[1L] ; dev[1L] <- NA
-        nas <- !is.na(dev)
-        P <- dev
-        ## BMB: hack to extract safe_pchisq
-        P[nas] <- stats:::safe_pchisq(dev[nas], dfs[nas], lower.tail = FALSE)
-        aod[, c("LRT", "Pr(F)")] <- list(dev, P)
     }
     head <- c("Single term deletions", "\nModel:", deparse(formula(object)),
 	      if(scale > 0) paste("\nscale: ", format(scale), "\n"))



More information about the Lme4-commits mailing list