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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri May 14 03:54:12 CEST 2010


Author: edd
Date: 2010-05-14 03:54:11 +0200 (Fri, 14 May 2010)
New Revision: 1237

Modified:
   pkg/RcppArmadillo/R/fastLm.R
Log:
small but important correction as Arma::colvec seemingly comes back a matrix
but doesn't drop to dimension 1


Modified: pkg/RcppArmadillo/R/fastLm.R
===================================================================
--- pkg/RcppArmadillo/R/fastLm.R	2010-05-14 00:58:17 UTC (rev 1236)
+++ pkg/RcppArmadillo/R/fastLm.R	2010-05-14 01:54:11 UTC (rev 1237)
@@ -34,6 +34,7 @@
     y <- as.numeric(y)
 
     res <- fastLmCall(y, x)
+    res$coefficients <- res$coefficient[,1] # force into single-col vector
 
     names(res$coefficients) <- colnames(res$vcov) <- rownames(res$vcov) <- colnames(x)
 
@@ -86,7 +87,6 @@
     y <- model.response(mf)
 
     res <- fastLm.default(x, y, ...)
-    names(res$coefficients) <- colnames(x) <- colnames(res$vcov) <- rownames(res$vcov) <- colnames(x)
     res$call <- match.call()
     res$formula <- formula
     res



More information about the Rcpp-commits mailing list