[Rcpp-commits] r2241 - papers/rjournal

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Sep 29 03:48:29 CEST 2010


Author: edd
Date: 2010-09-29 03:48:22 +0200 (Wed, 29 Sep 2010)
New Revision: 2241

Modified:
   papers/rjournal/EddelbuettelFrancois.tex
Log:
add a few missing Rcpp:: qualifiers
change nona() to noNA()


Modified: papers/rjournal/EddelbuettelFrancois.tex
===================================================================
--- papers/rjournal/EddelbuettelFrancois.tex	2010-09-29 01:18:07 UTC (rev 2240)
+++ papers/rjournal/EddelbuettelFrancois.tex	2010-09-29 01:48:22 UTC (rev 2241)
@@ -310,7 +310,7 @@
 code more concisely:
 
 \begin{example}
-CharacterVector ab(2);
+Rcpp::CharacterVector ab(2);
 ab[0] = "foo";
 ab[1] = "bar";
 \end{example}
@@ -772,16 +772,15 @@
 \begin{example}
 #include <Rcpp.h>
 
-RcppExport SEXP convolve11cpp(SEXP a, SEXP b) \{
-    Rcpp::NumericVector xa(a); 
-    Rcpp::NumericVector xb(b); 
+RcppExport SEXP convolve11cpp(SEXP a, SEXP b)\{
+    Rcpp::NumericVector xa(a), xb(b); 
     int n_xa = xa.size(), n_xb = xb.size();
     Rcpp::NumericVector xab(n_xa+n_xb-1,0.0);
     
     Rcpp::Range r( 0, n_xb-1 );
     for (int i=0; i<n_xa; i++, r++)
-        xab[ r ] += Rcpp::nona(xa[i]) 
-                    * Rcpp::nona(xb);
+        xab[ r ] += Rcpp::noNA(xa[i]) * 
+                    Rcpp::noNA(xb);
     return xab ;
 \}
 \end{example}



More information about the Rcpp-commits mailing list