[Rcpp-commits] r3697 - pkg/RcppArmadillo/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jul 18 16:00:41 CEST 2012


Author: edd
Date: 2012-07-18 16:00:40 +0200 (Wed, 18 Jul 2012)
New Revision: 3697

Modified:
   pkg/RcppArmadillo/R/fastLm.R
Log:
 o improved test for intercept with a tip of the hat to Doug


Modified: pkg/RcppArmadillo/R/fastLm.R
===================================================================
--- pkg/RcppArmadillo/R/fastLm.R	2012-07-18 13:39:46 UTC (rev 3696)
+++ pkg/RcppArmadillo/R/fastLm.R	2012-07-18 14:00:40 UTC (rev 3697)
@@ -42,7 +42,7 @@
     res$fitted.values <- as.vector(X %*% res$coefficients)
     res$residuals <- y - res$fitted.values
     res$call <- match.call()
-    res$intercept <- any(apply(X, 2, sd) == 0)
+    res$intercept <- any(apply(X, 2, function(x) all(x == 1)))
 
     class(res) <- "fastLm"
     res



More information about the Rcpp-commits mailing list