[Rcpp-commits] r3692 - in pkg/RcppArmadillo: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jul 15 01:13:37 CEST 2012


Author: edd
Date: 2012-07-15 01:13:37 +0200 (Sun, 15 Jul 2012)
New Revision: 3692

Modified:
   pkg/RcppArmadillo/ChangeLog
   pkg/RcppArmadillo/R/fastLm.R
Log:
 o automagically detect intercept use when not using a formuala too


Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2012-07-14 16:14:47 UTC (rev 3691)
+++ pkg/RcppArmadillo/ChangeLog	2012-07-14 23:13:37 UTC (rev 3692)
@@ -2,7 +2,8 @@
 
 	* R/fastLm.R (fastLm.formula): Note whether intercept in formula or
 	not; also store the result of summary() on residuals
-	* R/fastLm.R (print.summary.fastLm): Display summary of residuals 
+	* R/fastLm.R (fastLm.default): Autmagically detect intercept use
+	* R/fastLm.R (print.summary.fastLm): Display summary of residuals
 	* R/fastLm.R (summary.fastLm): Distinguish between the intercept and
 	no-intercept cases when computing R^2
 

Modified: pkg/RcppArmadillo/R/fastLm.R
===================================================================
--- pkg/RcppArmadillo/R/fastLm.R	2012-07-14 16:14:47 UTC (rev 3691)
+++ pkg/RcppArmadillo/R/fastLm.R	2012-07-14 23:13:37 UTC (rev 3692)
@@ -42,6 +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)
 
     class(res) <- "fastLm"
     res



More information about the Rcpp-commits mailing list