[Rcpp-commits] r1887 - in pkg/Rcpp/inst/doc: . Rcpp-quickref

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jul 30 11:54:05 CEST 2010


Author: romain
Date: 2010-07-30 11:54:04 +0200 (Fri, 30 Jul 2010)
New Revision: 1887

Modified:
   pkg/Rcpp/inst/doc/Makefile
   pkg/Rcpp/inst/doc/Rcpp-quickref/Rcpp-quickref.Rnw
Log:
some content in quickref

Modified: pkg/Rcpp/inst/doc/Makefile
===================================================================
--- pkg/Rcpp/inst/doc/Makefile	2010-07-30 09:36:14 UTC (rev 1886)
+++ pkg/Rcpp/inst/doc/Makefile	2010-07-30 09:54:04 UTC (rev 1887)
@@ -158,6 +158,7 @@
 	rm Rcpp-quickref.Rnw
 	cp -f Rcpp-quickref/Rcpp-quickref.Rnw .
 	Rscript -e "require(highlight); driver <- HighlightWeaveLatex(boxes = TRUE, bg = 'white' ); Sweave( 'Rcpp-quickref.Rnw', driver = driver ); "
+	Rscript -e "tex <- readLines('Rcpp-quickref.tex'); tex <- gsub( 'begin{minipage}{0.9', 'begin{minipage}{0.42', tex, fixed = TRUE ) ; writeLines( tex, 'Rcpp-quickref.tex' )  "
 	Rscript -e "tools::texi2dvi( 'Rcpp-quickref.tex', pdf = TRUE, clean = FALSE )"
 	# bibtex Rcpp-quickref
 ifeq ($(whoami),edd)
@@ -172,7 +173,7 @@
 	rm -fr Rcpp-quickref.aux
 	rm -fr Rcpp-quickref.out
 	rm -fr Rcpp-quickref.log
-	rm Rcpp-quickref.Rnw
+	rm -fr Rcpp-quickref.Rnw
 	cp Rcpp-quickref/Rcpp-quickref-fake.Rnw Rcpp-quickref.Rnw
 
 	

Modified: pkg/Rcpp/inst/doc/Rcpp-quickref/Rcpp-quickref.Rnw
===================================================================
--- pkg/Rcpp/inst/doc/Rcpp-quickref/Rcpp-quickref.Rnw	2010-07-30 09:36:14 UTC (rev 1886)
+++ pkg/Rcpp/inst/doc/Rcpp-quickref/Rcpp-quickref.Rnw	2010-07-30 09:54:04 UTC (rev 1887)
@@ -30,6 +30,28 @@
 \maketitle
 \thispagestyle{empty}
 
+% FIXME: without the dot, latex does not want to newline
+\paragraph{Simple Vectors}. \newline
 
+<<lang=cpp>>=
+SEXP x ; // from R
+std::vector<double> y(10) ;
+
+// from SEXP
+NumericVector xx(x) ;
+                     
+// of a given size (filled with 0)
+NumericVector xx(10) ; 
+// ... with a default for all values
+NumericVector xx(10, 2.0) ;
+
+// range constructor
+NumericVector xx( y.begin(), y.end() ) ;  
+
+// using create
+NumericVector xx = NumericVector::create( 
+  1.0, 2.0, 3.0, 4.0 ) ;
+@
+
 \end{document}
 



More information about the Rcpp-commits mailing list