<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>R-bloggers &#187; cplusplus</title>
	<atom:link href="http://www.r-bloggers.com/tag/cplusplus/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.r-bloggers.com</link>
	<description>R news and tutorials contributed by (300) R bloggers</description>
	<lastBuildDate>Tue, 07 Feb 2012 10:27:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>int64: 64 bit integer vectors for R</title>
		<link>http://www.r-bloggers.com/int64-64-bit-integer-vectors-for-r/</link>
		<comments>http://www.r-bloggers.com/int64-64-bit-integer-vectors-for-r/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 09:50:00 +0000</pubDate>
		<dc:creator>romain francois</dc:creator>
				<category><![CDATA[R bloggers]]></category>
		<category><![CDATA[cplusplus]]></category>
		<category><![CDATA[cran]]></category>
		<category><![CDATA[int64]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[R package]]></category>
		<category><![CDATA[Rcpp]]></category>
		<category><![CDATA[RProtoBuf]]></category>

		<guid isPermaLink="false">http://www.r-bloggers.com/?guid=bbaca728180bc01e7a76facb54353ff3</guid>
		<description><![CDATA[    

The Google Open Source Programs Office sponsored me to create the new int64 package that has been released to CRAN a few days ago. The package has been mentionned in an article in the open source blog from Google. 
 
The package defines classes i...]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 12px;">
(This article was first published on  <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2011/11/26/int64:-64-bit-integer-vectors-for-R"> Romain Francois, Professional R Enthusiast - Tag - R</a></strong>, and kindly contributed to <a href="http://www.r-bloggers.com/">R-bloggers)</a>      
</div></p>
    <a href="http://cran.r-project.org/web/packages/int64/index.html" ref="nofollow" target="_blank"><img src="http://romainfrancois.blog.free.fr/public/packages/int64/google-64.png" alt="google-64.png" style="margin: 0 auto; display: block;" title="google-64.png, nov. 2011" /></a>

<p>The <a href="http://code.google.com/opensource/" ref="nofollow" target="_blank">Google Open Source Programs Office</a> sponsored me to create the new <a href="http://cran.r-project.org/web/packages/int64/index.html" ref="nofollow" target="_blank">int64</a> package that has been released to CRAN a few days ago. The package has been mentionned in an article in the <a href="http://google-opensource.blogspot.com/2011/11/bringing-64-bit-data-to-r.html" ref="nofollow" target="_blank">open source blog from Google</a>. </p>
 
<p>The package defines classes int64 and uint64 that represent signed and unsigned 64 bit integer vectors. The package also allows conversion of several types (integer, numeric, character, logical) to 64 bit integer vectors, arithmetic operations as well as other standard group generic functions, and reading 64 bit integer vectors as a data.frame column using int64 or uint64 as the colClasses argument. </p>

<p>The package has a <a href="http://cran.r-project.org/web/packages/int64/vignettes/int64.pdf" ref="nofollow" target="_blank">vignette</a> that details its features, several examples are given in the usual help files. Once again, I've used <a href="http://cran.r-project.org/web/packages/RUnit/index.html" ref="nofollow" target="_blank">RUnit</a> for quality insurance about the package code</p>

<p><a href="http://cran.r-project.org/web/packages/int64/index.html" ref="nofollow" target="_blank">int64</a> has been developped so that 64 bit integer vectors are represented using only R data structures, i.e data is not represented as external pointers to some C++ object. Instead, each 64 bit integer is represented as a couple of regular 32 bit integers, each of them carrying half the bits of the underlying 64 bit integer. This was a choice by design so that 64 bit integer vectors can be serialized and used as data frame columns. </p>

<p>The package contains C++ headers that third party packages can used (via LinkingTo: int64) to use the C++ internals. This allows creation and manipulation of the objects in C++. The internals will be documented in another vignette for package developpers who wish to use the internals. For the moment, the main entry point is the C++ template class LongVector. </p>

<p>I'm particularly proud that Google trusted me to sponsor the development of <a href="http://cran.r-project.org/web/packages/int64/index.html" ref="nofollow" target="_blank">int64</a>. The next versions of packages <a href="http://dirk.eddelbuettel.com/code/rcpp.html" ref="nofollow" target="_blank">Rcpp</a> and <a href="http://dirk.eddelbuettel.com/code/rprotobuf.html" ref="nofollow" target="_blank">RProtoBuf</a> take advantage of the facilities of <a href="http://cran.r-project.org/web/packages/int64/index.html" ref="nofollow" target="_blank">int64</a>, e.g. Rcpp gains wrapping of C++ containers of 64 bit integers as R objects of classes int64 and uint64 and RProtoBuf improves handling of 64 bit integers in protobuf messages. More on this later</p>
<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 13px;">
<div style="text-align: center;">To <strong>leave a comment</strong> for the author, please follow the link and comment on his blog: <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2011/11/26/int64:-64-bit-integer-vectors-for-R"> Romain Francois, Professional R Enthusiast - Tag - R</a></strong>.</div>
<hr />
<a href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: visualization (<a title="ggplot and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" href="http://www.r-bloggers.com/?s=time+series">time series</a>,<a title="ecdf" href="http://www.r-bloggers.com/?s=ecdf">ecdf</a>, <a title="finance trading" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
</div></p>]]></content:encoded>
			<wfw:commentRss>http://www.r-bloggers.com/int64-64-bit-integer-vectors-for-r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rcpp workshop in Chicago on April 28th</title>
		<link>http://www.r-bloggers.com/rcpp-workshop-in-chicago-on-april-28th/</link>
		<comments>http://www.r-bloggers.com/rcpp-workshop-in-chicago-on-april-28th/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 07:54:00 +0000</pubDate>
		<dc:creator>romain francois</dc:creator>
				<category><![CDATA[R bloggers]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cplusplus]]></category>
		<category><![CDATA[finance]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[Rcpp]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[    Overview

  This year's R/Finance conference will be
  preceded by a full-day masterclass on Rcpp and related topics which will be
  held on Thursday, April 28, 2011, the Univ. of Illinois at Chicago campus.

  Join Dirk Eddelbuettel and  Romain Fr...]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 12px;">
(This article was first published on  <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2011/03/30/Rcpp-workshop-in-Chicago-on-April-28th"> Romain Francois, Professional R Enthusiast - Tag - R</a></strong>, and kindly contributed to <a href="http://www.r-bloggers.com/">R-bloggers)</a>      
</div></p>
    <h2>Overview</h2>

  <p>This year's <a href="http://www.rinfinance.com" ref="nofollow" target="_blank">R/Finance conference</a> will be
  preceded by a full-day masterclass on <a href="http://dirk.eddelbuettel.com/code/rcpp.html" ref="nofollow" target="_blank">Rcpp</a> and related topics which will be
  held on Thursday, April 28, 2011, the Univ. of Illinois at Chicago campus.</p>

  <p>Join <a href="http://dirk.eddelbuettel.com/" ref="nofollow" target="_blank">Dirk Eddelbuettel</a> and  <a href="http://romainfrancois.blog.free.fr/" ref="nofollow" target="_blank">Romain Francois</a> for six hours of detailed and
  hands-on instructions and discussions around Rcpp, inline, RInside,
  RcppArmadillo and other packages---in intimate small-group setting.</p>

  <p>The full-day format allows to combine a morning introductory session with a
  more advanced afternoon session while leaving room for sufficient breaks.
  There will be about six hours of instructions, a one-hour lunch break and
  two half-hour coffee breaks.</p>


 <h2>Morning session: "A hands-on introduction to R and C++"</h2>

  <p>The morning session will provide a practical introduction to the Rcpp
  package (and other related packages).  The focus will be on simple and
  straightforward applications of Rcpp in order to extend R and/or
  to significantly accelerate the execution of simple functions.</p>

 <p>The tutorial will cover the inline package which permits embedding of
  self-contained C, C++ or Fortran code in R scripts. We will also discuss
  RInside to embed R code in C++ applications, as well as standard Rcpp
  extension packages such as RcppArmadillo for linear algebra and RcppGSL.</p>


 <h2>Afternoon session: "Advanced R and C++ topics"</h2>

<p>This afternoon tutorial will provide a hands-on introduction to more
  advanced Rcpp features. It will cover topics such as writing packages that
  use Rcpp, how 'Rcpp modules' and the new R ReferenceClasses interact, and
  how 'Rcpp sugar' lets us write C++ code that is often as expressive as R
  code. Another possible topic, time permitting, may be writing glue code to
  extend Rcpp to other C++ projects.</p>

 <p>We also hope to leave some time to discuss problems brought by the class
  participants.</p>


  <h2>Prerequisites</h2>

  <p>Knowledge of R as well as general programming knowledge; C or C++ knowledge
  is helpful but not required.</p>

  <p>Users should bring a laptop set up so that R packages can be built. That
  means on Windows, Rtools needs to be present and working, and on OS X the
  Xcode package should be installed.</p>
	       
<h2>Registration</h2>

  <p>Registration is available via the R/Finance conference at</p>

		    <a href="http://www.rinfinance.com/register/" ref="nofollow" target="_blank">http://www.RinFinance.com/register/</a>

 <p>or directly at RegOnline</p>

		      <a href="http://www.regonline.com/930153" ref="nofollow" target="_blank">http://www.regonline.com/930153</a>

  <p>The cost is USD 500 for the whole day, and space will be limited.</p>       


 <h2>Questions</h2>

 <p>Please contact us directly at <a href="mailto:RomainAndDirk@r-enthusiasts.com" ref="nofollow" target="_blank">RomainAndDirk@r-enthusiasts.com</a>
<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 13px;">
<div style="text-align: center;">To <strong>leave a comment</strong> for the author, please follow the link and comment on his blog: <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2011/03/30/Rcpp-workshop-in-Chicago-on-April-28th"> Romain Francois, Professional R Enthusiast - Tag - R</a></strong>.</div>
<hr />
<a href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: visualization (<a title="ggplot and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" href="http://www.r-bloggers.com/?s=time+series">time series</a>,<a title="ecdf" href="http://www.r-bloggers.com/?s=ecdf">ecdf</a>, <a title="finance trading" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
</div></p>]]></content:encoded>
			<wfw:commentRss>http://www.r-bloggers.com/rcpp-workshop-in-chicago-on-april-28th/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RcppGSL 0.1.0</title>
		<link>http://www.r-bloggers.com/rcppgsl-0-1-0/</link>
		<comments>http://www.r-bloggers.com/rcppgsl-0-1-0/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 08:35:00 +0000</pubDate>
		<dc:creator>romain francois</dc:creator>
				<category><![CDATA[R bloggers]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cplusplus]]></category>
		<category><![CDATA[cran]]></category>
		<category><![CDATA[GSL]]></category>
		<category><![CDATA[inline]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[Rcpp]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[    

We released the first version of our RcppGSL package. RcppGSL extends Rcpp to help programmers code with the GNU Scientific Library (GSL). 

The package contains template classes in the RcppGSL namespace that act as smart pointers to the associat...]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 12px;">
(This article was first published on  <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/12/01/RcppGSL-0.1.0"> Romain Francois, Professional R Enthusiast</a></strong>, and kindly contributed to <a href="http://www.r-bloggers.com/">R-bloggers)</a>      
</div></p>
    <a href="http://www.flickr.com/photos/35772203@N08/3941189307/" title="Gnu de gerdavs, sur Flickr" ref="nofollow" target="_blank"><img src="http://www.r-bloggers.com/wp-content/uploads/2010/12/3941189307_0964092801.jpg" width="499" height="500" alt="Gnu" /></a>

<p>We released the first version of our RcppGSL package. RcppGSL extends <a href="http://dirk.eddelbuettel.com/code/rcpp.html" ref="nofollow" target="_blank">Rcpp</a> to help programmers code with the <a href="http://www.gnu.org/software/gsl/" ref="nofollow" target="_blank">GNU Scientific Library</a> (GSL). </p>

<p>The package contains template classes in the <strong>RcppGSL</strong> namespace that act as smart pointers to the associated GSL data structure. For example, a <strong>RcppGSL::vector&lt:double&gt;</strong> object acts a smart pointer to a <strong>gsl_vector*</strong>. Having the pointer shadowed by a smart pointer allows us to take advantage of C++ features such as operator overloading, etc ... which for example allows us to extract an element from the GSL vector simply using [] instead of GSL functions <strong>gsl_vector_get</strong> and <strong>gsl_vector_set</strong></p>

<p>The package contains a 11 pages vignette that explains the features in details, with examples. The vignette also discusses how to actually use RcppGSL, either in another package (preferred) or directly from the R prompt through the <a href="http://cran.r-project.org/web/packages/inline/index.html" ref="nofollow" target="_blank">inline</a> package.</p>
<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 13px;">
<div style="text-align: center;">To <strong>leave a comment</strong> for the author, please follow the link and comment on his blog: <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/12/01/RcppGSL-0.1.0"> Romain Francois, Professional R Enthusiast</a></strong>.</div>
<hr />
<a href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: visualization (<a title="ggplot and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" href="http://www.r-bloggers.com/?s=time+series">time series</a>,<a title="ecdf" href="http://www.r-bloggers.com/?s=ecdf">ecdf</a>, <a title="finance trading" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
</div></p>]]></content:encoded>
			<wfw:commentRss>http://www.r-bloggers.com/rcppgsl-0-1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rcpp 0.8.4</title>
		<link>http://www.r-bloggers.com/rcpp-0-8-4/</link>
		<comments>http://www.r-bloggers.com/rcpp-0-8-4/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 11:50:00 +0000</pubDate>
		<dc:creator>romain francois</dc:creator>
				<category><![CDATA[R bloggers]]></category>
		<category><![CDATA[cplusplus]]></category>
		<category><![CDATA[cran]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[Rcpp]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p><a href="http://dirk.eddelbuettel.com/blog/">Dirk</a> uploaded <a href="http://dirk.eddelbuettel.com/code/rcpp.html">Rcpp 0.8.4</a> to CRAN yesterday. 
This release quickly follows the release of <a href="http://dirk.eddelbuettel.com/blog/2010/06/29/#rcpp_0.8.3">Rcpp 0.8.3</a>, because there was some building problems (particularly on the ppc arch on OSX).</p>

<h3>Rcpp sugar</h3>

<p>
<a href="http://www.flickr.com/photos/sazztastical/2343536801/" title="Sugar:Cubed de sazztastical, sur Flickr"><img src="http://farm3.static.flickr.com/2111/2343536801_38c2398154.jpg" width="500" height="377" alt="Sugar:Cubed" /></a>
</p>

<p>Already available in <a href="http://dirk.eddelbuettel.com/blog/2010/06/29/#rcpp_0.8.3">Rcpp 0.8.3</a>, the new <em>sugar</em> feature was extended in 0.8.4 to cover more functions, and we have now started to adapt <em>sugar</em> for matrices with functions such as <strong>outer</strong>, <strong>row</strong>, <strong>diag</strong>, etc ...</p>

<p>Here is an example of using the sugar version of outer</p>


<pre>NumericVector xx<strong>(</strong>x<strong>)</strong> <strong>;</strong>
NumericVector yy<strong>(</strong>y<strong>)</strong><strong>;</strong>
NumericMatrix m <strong>=</strong> outer<strong>(</strong> xx<strong>,</strong> yy<strong>,</strong> std<strong>::</strong>plus<strong>&#60;</strong><strong>double</strong><strong>&#62;</strong><strong>(</strong><strong>)</strong> <strong>)</strong> <strong>;</strong>
<strong>return</strong> m <strong>;</strong>

</pre>

<p>This mimics the R code</p>

<pre>
&#62; outer( x, y, "+" )
</pre>

<p>Here is the relevant extract of the NEWS file: 

<pre>
0.8.4   2010-07-09

o   new sugar vector functions: rep, rep_len, rep_each, rev, head, tail, diag
	
o	sugar has been extended to matrices: The Matrix class now extends the Matrix_Base template that implements CRTP. Currently sugar functions for matrices are: outer, col, row, lower_tri, upper_tri, diag

o   The unit tests have been reorganised into fewer files with one call each to cxxfunction() (covering multiple tests) resulting in a significant speedup

o	The Date class now uses the same mktime() replacement that R uses (based on original code from the timezone library by Arthur Olson) permitting wide dates ranges on all operating systems

o   The FastLM/example has been updated, a new benchmark based on the historical Longley data set has been added

o   RcppStringVector now uses std::vector&#60;std::string&#62; internally

o    setting the .Data slot of S4 objects did not work properly

</pre>]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 12px;">
(This article was first published on  <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/07/10/Rcpp-0.8.5"> Romain Francois, Professional R Enthusiast</a></strong>, and kindly contributed to <a href="http://www.r-bloggers.com/">R-bloggers)</a>      
</div></p>
    <style type="text/css">
pre{
font-size: small ;
border : 1px solid gray ;
}
</style>

<p><a href="http://dirk.eddelbuettel.com/blog/" ref="nofollow" target="_blank">Dirk</a> uploaded <a href="http://dirk.eddelbuettel.com/code/rcpp.html" ref="nofollow" target="_blank">Rcpp 0.8.4</a> to CRAN yesterday. 
This release quickly follows the release of <a href="http://dirk.eddelbuettel.com/blog/2010/06/29/#rcpp_0.8.3" ref="nofollow" target="_blank">Rcpp 0.8.3</a>, because there was some building problems (particularly on the ppc arch on OSX).</p>

<h3>Rcpp sugar</h3>

<p>
<a href="http://www.flickr.com/photos/sazztastical/2343536801/" title="Sugar:Cubed de sazztastical, sur Flickr" ref="nofollow" target="_blank"><img src="http://www.r-bloggers.com/wp-content/uploads/2010/07/2343536801_38c2398154.jpg" width="500" height="377" alt="Sugar:Cubed" /></a>
</p>

<p>Already available in <a href="http://dirk.eddelbuettel.com/blog/2010/06/29/#rcpp_0.8.3" ref="nofollow" target="_blank">Rcpp 0.8.3</a>, the new <em>sugar</em> feature was extended in 0.8.4 to cover more functions, and we have now started to adapt <em>sugar</em> for matrices with functions such as <strong>outer</strong>, <strong>row</strong>, <strong>diag</strong>, etc ...</p>

<p>Here is an example of using the sugar version of outer</p>


<pre><font color="#000000">NumericVector <font color="#9966ff">xx</font><font color="#000000"><strong>(</strong></font>x<font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>;</strong></font>
NumericVector <font color="#9966ff">yy</font><font color="#000000"><strong>(</strong></font>y<font color="#000000"><strong>)</strong></font><font color="#000000"><strong>;</strong></font>
NumericMatrix m <font color="#000000"><strong>=</strong></font> <font color="#9966ff">outer</font><font color="#000000"><strong>(</strong></font> xx<font color="#000000"><strong>,</strong></font> yy<font color="#000000"><strong>,</strong></font> std<font color="#000000"><strong>::</strong></font>plus<font color="#000000"><strong>&lt;</strong></font><font color="#0099ff"><strong>double</strong></font><font color="#000000"><strong>&gt;</strong></font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>;</strong></font>
<font color="#006699"><strong>return</strong></font> m <font color="#000000"><strong>;</strong></font>

</font></pre>

<p>This mimics the R code</p>

<pre>
&gt; outer( x, y, "+" )
</pre>

<p>Here is the relevant extract of the NEWS file: 

<pre>
0.8.4   2010-07-09

o   new sugar vector functions: rep, rep_len, rep_each, rev, head, tail, diag
	
o	sugar has been extended to matrices: The Matrix class now extends the Matrix_Base template that implements CRTP. Currently sugar functions for matrices are: outer, col, row, lower_tri, upper_tri, diag

o   The unit tests have been reorganised into fewer files with one call each to cxxfunction() (covering multiple tests) resulting in a significant speedup

o	The Date class now uses the same mktime() replacement that R uses (based on original code from the timezone library by Arthur Olson) permitting wide dates ranges on all operating systems

o   The FastLM/example has been updated, a new benchmark based on the historical Longley data set has been added

o   RcppStringVector now uses std::vector&lt;std::string&gt; internally

o    setting the .Data slot of S4 objects did not work properly

</pre>
<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 13px;">
<div style="text-align: center;">To <strong>leave a comment</strong> for the author, please follow the link and comment on his blog: <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/07/10/Rcpp-0.8.5"> Romain Francois, Professional R Enthusiast</a></strong>.</div>
<hr />
<a href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: visualization (<a title="ggplot and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" href="http://www.r-bloggers.com/?s=time+series">time series</a>,<a title="ecdf" href="http://www.r-bloggers.com/?s=ecdf">ecdf</a>, <a title="finance trading" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
</div></p>]]></content:encoded>
			<wfw:commentRss>http://www.r-bloggers.com/rcpp-0-8-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rmetrics slides</title>
		<link>http://www.r-bloggers.com/rmetrics-slides/</link>
		<comments>http://www.r-bloggers.com/rmetrics-slides/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 16:37:00 +0000</pubDate>
		<dc:creator>romain francois</dc:creator>
				<category><![CDATA[R bloggers]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[cplusplus]]></category>
		<category><![CDATA[Rcpp]]></category>
		<category><![CDATA[rmetrics]]></category>
		<category><![CDATA[slides]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[    I presented Rcpp at the Rmetrics conference earlier today, this was a really good opportunity to look back at all the work Dirk and I have been commiting into Rcpp. 

I've uploaded my slides here (pdf) and on slideshare :

Rcpp: Seemless R and C++V...]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 12px;">
(This article was first published on  <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/06/30/Rmetrics-slides"> Romain Francois, Professional R Enthusiast</a></strong>, and kindly contributed to <a href="http://www.r-bloggers.com/">R-bloggers)</a>      
</div></p>
    <p>I presented <a href="http://dirk.eddelbuettel.com/code/rcpp.html" ref="nofollow" target="_blank">Rcpp</a> at the <a href="https://www.rmetrics.org/meielisalp2010" ref="nofollow" target="_blank">Rmetrics</a> conference earlier today, this was a really good opportunity to look back at all the work Dirk and I have been commiting into Rcpp. </p>

<p>I've uploaded my slides <a href="http://addictedtor.free.fr/slides/rmetrics-2010.pdf" ref="nofollow" target="_blank">here (pdf)</a> and on <a href="http://www.slideshare.net/romainfrancois" ref="nofollow" target="_blank">slideshare</a> :</p>

<div style="width:425px;margin-left:40px" id="__ss_4725039"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/romainfrancois/rcpp-seemless-r-and-c" title="Rcpp: Seemless R and C++" ref="nofollow" target="_blank">Rcpp: Seemless R and C++</a></strong><object id="__sse4725039" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rmetrics-100710041915-phpapp02&rel=0&stripped_title=rcpp-seemless-r-and-c" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse4725039" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rmetrics-100710041915-phpapp02&rel=0&stripped_title=rcpp-seemless-r-and-c" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/" ref="nofollow" target="_blank">presentations</a> from <a href="http://www.slideshare.net/romainfrancois" ref="nofollow" target="_blank">romainfrancois</a>.</div></div>

<p>and some pictures on <a href="http://www.flickr.com/photos/51923411@N03/sets/72157624462003158/" ref="nofollow" target="_blank">flickr</a>: </p>

<object width="500" height="375"> <param name="flashvars" value="offsite=true&lang=fr-fr&page_show_url=%2Fphotos%2F51923411%40N03%2Fsets%2F72157624462003158%2Fshow%2F&page_show_back_url=%2Fphotos%2F51923411%40N03%2Fsets%2F72157624462003158%2F&set_id=72157624462003158&jump_to="></param> <param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=71649"></param> <param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/slideshow/show.swf?v=71649" allowFullScreen="true" flashvars="offsite=true&lang=fr-fr&page_show_url=%2Fphotos%2F51923411%40N03%2Fsets%2F72157624462003158%2Fshow%2F&page_show_back_url=%2Fphotos%2F51923411%40N03%2Fsets%2F72157624462003158%2F&set_id=72157624462003158&jump_to=" width="500" height="375"></embed></object>
<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 13px;">
<div style="text-align: center;">To <strong>leave a comment</strong> for the author, please follow the link and comment on his blog: <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/06/30/Rmetrics-slides"> Romain Francois, Professional R Enthusiast</a></strong>.</div>
<hr />
<a href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: visualization (<a title="ggplot and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" href="http://www.r-bloggers.com/?s=time+series">time series</a>,<a title="ecdf" href="http://www.r-bloggers.com/?s=ecdf">ecdf</a>, <a title="finance trading" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
</div></p>]]></content:encoded>
			<wfw:commentRss>http://www.r-bloggers.com/rmetrics-slides/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rcpp 0.8.1</title>
		<link>http://www.r-bloggers.com/rcpp-0-8-1/</link>
		<comments>http://www.r-bloggers.com/rcpp-0-8-1/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 11:24:00 +0000</pubDate>
		<dc:creator>romain francois</dc:creator>
				<category><![CDATA[R bloggers]]></category>
		<category><![CDATA[cplusplus]]></category>
		<category><![CDATA[cran]]></category>
		<category><![CDATA[modules]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[Rcpp]]></category>
		<category><![CDATA[vignette]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[    We released Rcpp 0.8.0 almost a month ago. It finalized our efforts in designing a better, faster and more natural API than any version of Rcpp ever before. The journey from Rcpp 0.7.0 to ]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 12px;">
(This article was first published on  <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/06/08/Rcpp-0.8.1"> Romain Francois, Professional R Enthusiast</a></strong>, and kindly contributed to <a href="http://www.r-bloggers.com/">R-bloggers)</a>      
</div></p>
    <p>We released <a href="http://romainfrancois.blog.free.fr/index.php?post/2010/05/17/Rcpp-0.8.0" ref="nofollow" target="_blank">Rcpp 0.8.0</a> almost a month ago. It finalized our efforts in designing a better, faster and more natural API than any version of Rcpp ever before. The journey from <a href="http://dirk.eddelbuettel.com/blog/2009/12/19/" ref="nofollow" target="_blank">Rcpp 0.7.0</a> to <a href="http://romainfrancois.blog.free.fr/index.php?post/2010/05/17/Rcpp-0.8.0" ref="nofollow" target="_blank">Rcpp 0.8.0</a> has mainly been a coding and testing effort for designing the API. </p>

<h3>And now for something completely different</h3>

<p>We have now started (with release 0.8.1 of Rcpp) a new development cycle towards the 0.9.0 version with two major goals in mind</p>

<ul>
<li>We want to improve documentation. To that end Rcpp 0.8.1 includes 4 new vignettes. more on that later. </li>
<li>We want to cross the boundaries between R and C++. Rcpp 0.8.1 introduces <strong>Rcpp modules</strong>. Modules allows the programmer to expose C++ classes and functions at the R level, with great ease. </li>
</ul>

<h3>new vignettes</h3>

<p><a href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-FAQ.pdf" ref="nofollow" target="_blank">Rcpp-FAQ</a> :<em>Frequently Asked Questions about Rcpp</em> collects some of the frequently asked questions from the <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" ref="nofollow" target="_blank">mailing list</a> and from private exchanges with many people. </p>

<p><a href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-extending.pdf" ref="nofollow" target="_blank">Rcpp-extending</a>:  <em>Extending Rcpp</em> shows how to extend Rcpp converters Rcpp::wrap and Rcpp::as to user defined types (C++ classes defined in someone else's package and third party types (C++ classes defined in some third party library used by a package. The document is based on our experience developping the <a href="http://dirk.eddelbuettel.com/code/rcpp.armadillo.html" ref="nofollow" target="_blank">RcppArmadillo</a> package</p>

<p><a href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-package.pdf" ref="nofollow" target="_blank">Rcpp-package</a> : <em>Writing a package that uses Rcpp</em> highlights the steps involved in making a package that uses Rcpp. The document is based on the Rcpp.package.skeleton function</p>

<p>finally, <a href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf" ref="nofollow" target="_blank">Rcpp-modules</a> : <em>Exposing C++ functions and classes with Rcpp modules</em> documents the current feature set of Rcpp modules</p>

<h3>Rcpp modules</h3>

<p>Rcpp modules are inspired from the <a href="http://www.boost.org/doc/libs/1_43_0/libs/python/doc/index.html" ref="nofollow" target="_blank">Boost.Python</a> C++ library. Rcpp modules let you expose C++ classes and functions to the R level with minimal involvment from the programmer</p>

<p>The feature is best described by an example (more examples on the vignette). Say we want to expose this simple class: </p>

<iframe src="http://romainfrancois.blog.free.fr/public/packages/Rcpp/modules/w.html" width=500 height=180></iframe>

<p>This would typically involve <a href="http://romainfrancois.blog.free.fr/index.php?post/2010/01/08/External-pointers-with-Rcpp" ref="nofollow" target="_blank">external pointers</a>. With Rcpp modules, we can simply declare <strong>what</strong> we want to expose about this class, and Rcpp takes care of the <strong>how</strong> to expose it: </p>

<iframe src="http://romainfrancois.blog.free.fr/public/packages/Rcpp/modules/y.html" width=500 height=180></iframe>

<p>The R side consists of grabbing a reference to the module, and just use the World class</p>

<iframe src="http://romainfrancois.blog.free.fr/public/packages/Rcpp/modules/m.html" width=500 height=180></iframe>

<p>The <a href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf" ref="nofollow" target="_blank">Rcpp-modules</a> vignette gives more details about modules, including how to use them in packages</p>

<h3>More details about 0.8.1 release</h3>

<p>Here is the complete extract from our NEWS file about this release</p>

<iframe src="http://romainfrancois.blog.free.fr/public/packages/Rcpp/modules/n.html" width=500 height=250></iframe>
<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 13px;">
<div style="text-align: center;">To <strong>leave a comment</strong> for the author, please follow the link and comment on his blog: <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/06/08/Rcpp-0.8.1"> Romain Francois, Professional R Enthusiast</a></strong>.</div>
<hr />
<a href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: visualization (<a title="ggplot and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" href="http://www.r-bloggers.com/?s=time+series">time series</a>,<a title="ecdf" href="http://www.r-bloggers.com/?s=ecdf">ecdf</a>, <a title="finance trading" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
</div></p>]]></content:encoded>
			<wfw:commentRss>http://www.r-bloggers.com/rcpp-0-8-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>inline 0.3.5</title>
		<link>http://www.r-bloggers.com/inline-0-3-5/</link>
		<comments>http://www.r-bloggers.com/inline-0-3-5/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 09:08:00 +0000</pubDate>
		<dc:creator>romain francois</dc:creator>
				<category><![CDATA[R bloggers]]></category>
		<category><![CDATA[cplusplus]]></category>
		<category><![CDATA[cran]]></category>
		<category><![CDATA[inline]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[Rcpp]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[    The inline package is an amazing, yet simple, package for R. It allows to dynamically (within the R session) define R functions and S4 methods with inlined C/C++/Fortran code.

Together with RUnit, inline powers the entire unit test suite of Rcpp. ...]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 12px;">
(This article was first published on  <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/06/02/inline-0.3.5"> Romain Francois, Professional R Enthusiast</a></strong>, and kindly contributed to <a href="http://www.r-bloggers.com/">R-bloggers)</a>      
</div></p>
    <p>The <a href="http://cran.r-project.org/web/packages/inline/index.html" ref="nofollow" target="_blank">inline</a> package is an amazing, yet simple, package for R. It allows to dynamically (within the R session) define R functions and S4 methods with inlined C/C++/Fortran code.</p>

<p>Together with RUnit, inline powers the entire unit test suite of <a href="http://dirk.eddelbuettel.com/code/rcpp.html" ref="nofollow" target="_blank">Rcpp</a>. </p>

<p>As agreed with Oleg Sklyar, who maintains inline, we made a few additions to inline to accomodate the needs of the <a href="http://romainfrancois.blog.free.fr/index.php?category/R-package/Rcpp" ref="nofollow" target="_blank">Rcpp</a> family of packages. </p>

<h3>cxxfunction</h3>

<p>The main addition is <a href="http://finzi.psych.upenn.edu/R/library/inline/html/cxxfunction.html" ref="nofollow" target="_blank">cxxfunction</a> which is very similar to <a href="http://finzi.psych.upenn.edu/R/library/inline/html/cfunction.html" ref="nofollow" target="_blank">cfunction</a>, except that it only focuses on C++ code using the <a href="http://finzi.psych.upenn.edu/R/library/base/html/Foreign.html" ref="nofollow" target="_blank">.Call</a> calling convention. <a href="http://finzi.psych.upenn.edu/R/library/inline/html/cxxfunction.html" ref="nofollow" target="_blank">cxxfunction</a> uses a plugin system allowing other packages to control the code that is generated before compilation, environment variables, etc ... For example, the next version of 
<a href="http://dirk.eddelbuettel.com/code/rcpp.html" ref="nofollow" target="_blank">Rcpp</a> defines an inline plugin that takes care of all the details (find the Rcpp include path, link against the Rcpp user library, etc ...) </p>

<p>Here is an example, from the <a href="http://finzi.psych.upenn.edu/R/library/inline/html/cxxfunction.html" ref="nofollow" target="_blank">cxxfunction</a> help page using the Rcpp plugin (this will only work with the next version of Rcpp, because the current version does not know about this)</p> 

<iframe src="http://romainfrancois.blog.free.fr/public/packages/inline/cxx.R.html" width=500 height=100></iframe>

<p>Here is an example using the plugin from the next version of <a href="http://dirk.eddelbuettel.com/code/rcpp.armadillo.html" ref="nofollow" target="_blank">RcppArmadillo</a></p>

<iframe src="http://romainfrancois.blog.free.fr/public/packages/inline/cxxarma.R.html" width=500 height=120></iframe>

<h3>package.skeleton</h3>

<p>Another addition to inline concerns the <a href="http://finzi.psych.upenn.edu/R/library/utils/html/package.skeleton.html" ref="nofollow" target="_blank">package.skeleton</a>. We've made it S4 generic in inline and defined methods for the <strong>CFunc</strong> and <strong>CFuncList</strong> classes. In short, this allows to prototype some code using inline and quickly dump the code into a proper package</p>

<p>For example, here we make two functions using cxxfunction and then generate a package skeleton directly from them</p>

<iframe src="http://romainfrancois.blog.free.fr/public/packages/inline/packskel.html" width=500 height=190></iframe>

<p>Furthermore, the package.skeleton methods are aware of the plugin system, which allows plugin to have some control of additional steps involved in making the package skeleton, such as Makevars files, etc ... </p>


<h3>getDynLib</h3>

<p><strong>getDynLib</strong> has been introduced in this version of inline to grab a reference to the dynamic library associated with a package, a function (CFunc object) generated by inline, or a set of functions (CFuncList object) generated by inline</p>
<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 13px;">
<div style="text-align: center;">To <strong>leave a comment</strong> for the author, please follow the link and comment on his blog: <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/06/02/inline-0.3.5"> Romain Francois, Professional R Enthusiast</a></strong>.</div>
<hr />
<a href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: visualization (<a title="ggplot and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" href="http://www.r-bloggers.com/?s=time+series">time series</a>,<a title="ecdf" href="http://www.r-bloggers.com/?s=ecdf">ecdf</a>, <a title="finance trading" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
</div></p>]]></content:encoded>
			<wfw:commentRss>http://www.r-bloggers.com/inline-0-3-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RcppArmadillo 0.2.1</title>
		<link>http://www.r-bloggers.com/rcpparmadillo-0-2-1/</link>
		<comments>http://www.r-bloggers.com/rcpparmadillo-0-2-1/#comments</comments>
		<pubDate>Wed, 19 May 2010 07:50:00 +0000</pubDate>
		<dc:creator>romain francois</dc:creator>
				<category><![CDATA[R bloggers]]></category>
		<category><![CDATA[cplusplus]]></category>
		<category><![CDATA[cran]]></category>
		<category><![CDATA[Rcpp]]></category>
		<category><![CDATA[RcppArmadillo]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[    Armadillo

Armadillo is a C++ linear algebra library aiming towards a good balance
between speed and ease of use. Integer, floating point and complex numbers
are supported, as well as a subset of trigonometric and statistics
functions. Various matr...]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 12px;">
(This article was first published on  <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/05/19/RcppArmadillo-0.2.1"> Romain Francois, Professional R Enthusiast</a></strong>, and kindly contributed to <a href="http://www.r-bloggers.com/">R-bloggers)</a>      
</div></p>
    <h2>Armadillo</h2>

<p><a href="http://arma.sourceforge.net/" ref="nofollow" target="_blank">Armadillo</a> is a C++ linear algebra library aiming towards a good balance
between speed and ease of use. Integer, floating point and complex numbers
are supported, as well as a subset of trigonometric and statistics
functions. Various matrix decompositions are provided through optional
integration with LAPACK and ATLAS libraries.</p>

<p>A delayed evaluation approach is employed (during compile time) to combine
several operations into one and reduce (or eliminate) the need for
temporaries.  This is accomplished through recursive templates and template
meta-programming.</p>

<p>This library is useful if C++ has been decided as the language of choice 
(due to speed and/or integration capabilities), rather than another language 
like Matlab or Octave. It is distributed under a license that is useful in 
both open-source and commercial contexts.</p>

<p>Armadillo is primarily developed by 
<a href="http://www.itee.uq.edu.au/~conrad/" ref="nofollow" target="_blank">Conrad Sanderson</a> at 
<a href="http://nicta.com.au/research/project_list" ref="nofollow" target="_blank">NICTA</a> (Australia),
with contributions from around the world.</p>


<h2>RcppArmadillo</h2>

<p><a href="http://dirk.eddelbuettel.com/code/rcpp.armadillo.html" ref="nofollow" target="_blank">RcppArmadillo</a> 
is an R package that facilitates using Armadillo classes
in R packages through <a href="http://dirk.eddelbuettel.com/code/rcpp.html" ref="nofollow" target="_blank">Rcpp</a>. 
It achieves the integration by extending Rcpp's
data interchange concepts to <a href="http://arma.sourceforge.net/" ref="nofollow" target="_blank">Armadillo</a> classes.</p>


<h2>Example</h2>

<p>Here is a simple implementation of a fast linear regression (provided by
RcppArmadillo via the
<a href="http://finzi.psych.upenn.edu/R/library/RcppArmadillo/html/fastLm.html" ref="nofollow" target="_blank">fastLm()</a> function):</p>

<iframe src="http://romainfrancois.blog.free.fr/public/packages/RcppArmadillo/fastlm.cpp.html" width=500 height=400></iframe>

<p>Note however that you may not want to compute a linear regression fit this
way in order to protect from numerical inaccuracies on rank-deficient
problems. The help page for 
<a href="http://finzi.psych.upenn.edu/R/library/RcppArmadillo/html/fastLm.html" ref="nofollow" target="_blank">fastLm()</a> 
provides an example.</p>


<h2>Using RcppArmadillo in other packages</h2>

<p><a href="http://dirk.eddelbuettel.com/code/rcpp.armadillo.html" ref="nofollow" target="_blank">RcppArmadillo</a> 
is designed so that its classes can be used from other packages. </p>

<p>Using RcppArmadillo requires: </p>

<ul>
<li><p>Using the header files provided by Rcpp and RcppArmadillo. This is 
   typically achieved by adding this line in the DESCRIPTION file of the 
   client package:</p>
   
<pre>LinkingTo : Rcpp, RcppArmadillo</pre>
   
   <p>and the following line in the package code:</p> 
   
<pre>#include &lt;RcppArmadillo.h&gt;</pre>
</li>

<li><p>Linking against Rcpp dynamic or shared library and librairies needed
   by Armadillo, which is achieved by adding this line in the src/Makevars
   file of the client package</p> 
   
<pre>
PKG_LIBS = $(shell $(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()" ) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
</pre>

   <p>and this line in the file src/Makevars.win:</p> 
   
<pre>
PKG_LIBS = $(shell Rscript.exe -e "Rcpp:::LdFlags()") $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
</pre>
</li>
</ul>

<p>RcppArmadillo contains a function 
<a href="http://finzi.psych.upenn.edu/R/library/RcppArmadillo/html/RcppArmadillo.package.skeleton.html" ref="nofollow" target="_blank">RcppArmadillo.package.skeleton</a>, modelled
after package.skeleton from the utils package in base R, that creates a 
skeleton of a package using RcppArmadillo, including example code.</p>


<h2>Quality Assurance</h2>

<p>RcppArmadillo uses the RUnit package by Matthias Burger et al to provide 
unit testing. RcppArmadillo currently has 19 unit tests (called from 8 unit 
test functions). </p>

<p>Source code for unit test functions are stored in the unitTests directory 
of the installed package and the results are collected in the 
<a href="http://cran.r-project.org/web/packages/RcppArmadillo/vignettes/RcppArmadillo-unitTests.pdf" ref="nofollow" target="_blank">RcppArmadillo-unitTests</a> vignette. </p>

<p>We run unit tests before sending the package to CRAN on as many systems as
possible, including Mac OSX (Snow Leopard), Debian, Ubuntu, Fedora 12
(64bit), Win 32 and Win64.</p>

<p>Unit tests can also be run from the installed package by executing</p>

<pre>RcppArmadillo:::test()</pre>

<p>where an output directory can be provided as an optional first argument.</p>


<h2>Links</h2>

<ul>
<li>Armadillo : <a href="http://arma.sourceforge.net/" ref="nofollow" target="_blank">http://arma.sourceforge.net/</a>  </li>
<li>RcppArmadillo main page: <a href="http://dirk.eddelbuettel.com/code/rcpp.armadillo.html" ref="nofollow" target="_blank">http://dirk.eddelbuettel.com/code/rcpp.armadillo.html</a></li>  
<li>R-forge Rcpp project page: <a href="http://r-forge.r-project.org/projects/rcpp/" ref="nofollow" target="_blank">http://r-forge.r-project.org/projects/rcpp/ </a></li>   
<li>Dirk's blog : <a href="http://dirk.eddelbuettel.com/blog/code/rcpp/" ref="nofollow" target="_blank">http://dirk.eddelbuettel.com/blog/code/rcpp/ </a></li>
<li>Romain's blog : <a href="http://romainfrancois.blog.free.fr/index.php?category/R-package/RcppArmadillo" ref="nofollow" target="_blank">http://romainfrancois.blog.free.fr/index.php?category/R-package/RcppArmadillo</a></li>
</ul>

<h2>Support</h2>

<p>Questions about RcppArmadillo should be directed to the Rcpp-devel mailing
list at
  <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" ref="nofollow" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a>
</p>

<p>Questions about Armadillo itself should be directed to its forum
<a href="http://sourceforge.net/apps/phpbb/arma/" ref="nofollow" target="_blank">http://sourceforge.net/apps/phpbb/arma/</a></p>


<pre> -- Romain Francois, Montpellier, France
    Dirk Eddelbuettel, Chicago, IL, USA
    Doug Bates, Madison, WI, USA

    May 2010
</pre>
<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 13px;">
<div style="text-align: center;">To <strong>leave a comment</strong> for the author, please follow the link and comment on his blog: <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/05/19/RcppArmadillo-0.2.1"> Romain Francois, Professional R Enthusiast</a></strong>.</div>
<hr />
<a href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: visualization (<a title="ggplot and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" href="http://www.r-bloggers.com/?s=time+series">time series</a>,<a title="ecdf" href="http://www.r-bloggers.com/?s=ecdf">ecdf</a>, <a title="finance trading" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
</div></p>]]></content:encoded>
			<wfw:commentRss>http://www.r-bloggers.com/rcpparmadillo-0-2-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rcpp 0.8.0</title>
		<link>http://www.r-bloggers.com/rcpp-0-8-0/</link>
		<comments>http://www.r-bloggers.com/rcpp-0-8-0/#comments</comments>
		<pubDate>Wed, 12 May 2010 07:18:00 +0000</pubDate>
		<dc:creator>romain francois</dc:creator>
				<category><![CDATA[R bloggers]]></category>
		<category><![CDATA[cplusplus]]></category>
		<category><![CDATA[cran]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[Rcpp]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[    Summary

Version 0.8.0 of the Rcpp package was released to CRAN today. This release marks another milestone in the ongoing redesign of the package, and
underlying C++ library.


Overview

Rcpp is an R package and C++ library that facilitates integr...]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 12px;">
(This article was first published on  <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/05/17/Rcpp-0.8.0"> Romain Francois, Professional R Enthusiast</a></strong>, and kindly contributed to <a href="http://www.r-bloggers.com/">R-bloggers)</a>      
</div></p>
    <h2>Summary</h2>

<p>Version 0.8.0 of the <a href="http://dirk.eddelbuettel.com/code/rcpp.html" ref="nofollow" target="_blank">Rcpp</a> package was released to CRAN today. This release marks another milestone in the ongoing redesign of the package, and
underlying C++ library.</p>


<h2>Overview</h2>

<p>Rcpp is an R package and C++ library that facilitates integration of C++
code in R packages. </p>

<p>The package features a set of C++ classes (<strong>Rcpp::IntegerVector,
Rcpp::Function, Rcpp::Environment, </strong>...) that makes it easier to manipulate R
objects of matching types (integer vectors, functions, environments, etc
...).
</p>

<p>Rcpp takes advantage of C++ language features such as the explicit
constructor/destructor lifecycle of objects to manage garbage collection
automatically and transparently. We believe this is a major improvement over
<strong>PROTECT/UNPROTECT</strong>. When an Rcpp object is created, it protects the underlying
SEXP so that the garbage collector does not attempt to reclaim the
memory. This protection is withdrawn when the object goes out of
scope. Moreover, users generally do not need to manage memory directly (via
calls to new / delete or malloc / free) as this is done by the Rcpp classes
or the corresponding STL containers.
</p>

<h2>API</h2>

<p>Rcpp provides two APIs: an older set of classes we refer to the classic API
(see below for the section 'Backwards Compatibility) as well as second and
newer set of classes. 
</p>

<p>Classes of the new Rcpp API belong to the Rcpp namespace. Each class is
associated to a given SEXP type and exposes an interface that allows
manipulation of the object that may feel more natural than the usual use of
macros and functions provided by the R API.
</p>

<div style="margin-left: 50px;">
<TABLE border=1 cellspacing=0 cellpadding=0>
<TR> <TH> SEXP type </TH> <TH> Rcpp class </TH>  </TR>
  <TR> <TD> INTSXP             </TD> <TD>     Rcpp::IntegerVector         </TD> </TR>
  <TR> <TD> REALSXP            </TD> <TD>     Rcpp::NumericVector </TD> </TR>
  <TR> <TD> RAWSXP             </TD> <TD>     Rcpp::RawVector </TD> </TR>
  <TR> <TD> LGLSXP             </TD> <TD>     Rcpp::LogicalVector </TD> </TR>
  <TR> <TD> CPLXSXP            </TD> <TD>     Rcpp::ComplexVector  </TD> </TR>
  <TR> <TD> STRSXP             </TD> <TD>     Rcpp::CharacterVector </TD> </TR>
  <TR> <TD> VECSXP             </TD> <TD>     Rcpp::List </TD> </TR>
  <TR> <TD> EXPRSXP            </TD> <TD>     Rcpp::ExpressionVector </TD> </TR>
  <TR> <TD> ENVSXP             </TD> <TD>     Rcpp::Environment </TD> </TR>
  <TR> <TD> SYMSXP             </TD> <TD>     Rcpp::Symbol </TD> </TR>
  <TR> <TD> CLOSXP             </TD> <TD>  </TD> </TR>
  <TR> <TD> BUILTINSXP         </TD> <TD>     Rcpp::Function </TD> </TR>
  <TR> <TD> SPECIALSXP         </TD> <TD>  </TD> </TR>
  <TR> <TD> LANGSXP            </TD> <TD>     Rcpp::Language </TD> </TR>
  <TR> <TD> LISTSXP            </TD> <TD>     Rcpp::Pairlist </TD> </TR>
  <TR> <TD> S4SXP              </TD> <TD>     Rcpp::S4 </TD> </TR>
  <TR> <TD> PROMSXP            </TD> <TD>     Rcpp::Promise </TD> </TR>
  <TR> <TD> WEAKREFSXP         </TD> <TD>     Rcpp::WeakReference </TD> </TR>
  <TR> <TD> EXTPTRSXP          </TD> <TD>     template &lt; typename T&gt;  Rcpp::XPtr &nbsp;&nbsp;&nbsp;</TD> </TR>
</TABLE>
</div>

<p>Some SEXP types do not have dedicated Rcpp classes : <strong>NILSXP, DOTSXP, 
ANYSXP, BCODESXP and CHARSXP</strong>. </p>

<p>Still missing are a few convenience classes such as Rcpp::Date or
Rcpp::Datetime which would map useful and frequently used R data types, but
which do not have an underlying SEXP type.</p>


<h2>Data Interchange</h2>

<p>Data interchange between R and C++ is managed by extensible and powerful yet
simple mechanisms.</p>

<p>Conversion of a C++ object is managed by the template function <strong>Rcpp::wrap</strong>. 
This function currently manages :
<ul>
<li>primitive types : int, double, bool, float, Rbyte, ...</li>
<li>std::string, const char*</li>
<li>STL containers such as std::vector&lt;T&gt; and STL maps such as 
   std::mapr&lt; std::string, Tr&gt; provided that the template type T is wrappable </li>
 <li>any class that can be implicitely converted to SEXP, through operator SEXP()</li>
</ul>
</p>


<p>Conversion of an R object to a C++ object is managed by the Rcpp::as&lt;T&gt;
template which can handle:
<ul>
<li>primitive types</li>
<li>std::string, const char* </li>
<li>STL containers such as std::vector&lt;T&gt;</li>
</ul>
</p>

<p><strong>Rcpp::wrap</strong> and <strong>Rcpp::as</strong> are often used implicitely. For example, when
assigning objects to an environment:</p>


<pre>
  // grab the global environment
  Rcpp::Environment global = Rcpp::Environment::global_env() ;
  std::deque<bool> z( 3 ); z[0] = false; z[1] = true; z[3] = false ;

  global["x"] = 2 ;                    // implicit call of wrap<int>
  global["y"] = "foo";                 // implicit call of wrap<char*>
  global["z"] = z ;                    // impl. call of wrap<std::deque<bool>>

  int x = global["x"] ;                // implicit call of as<int>
  std::string y = global["y"]          // implicit call of as<std::string>
  std::vector<bool> z1 = global["z"] ; // impl. call of as<std::vector<bool>>
</pre>

<p>
Rcpp contains several examples that illustrate wrap and as. The mechanism was 
designed to be extensible. We have developped separate packages to illustrate
how to extend Rcpp conversion mechanisms to third party types. 
<ul>
<li>RcppArmadillo : conversion of types from the Armadillo C++ library. </li>
<li>RcppGSL       : conversion of types from the GNU Scientific Library. </li>
</ul>
</p>

<p>Rcpp is also used for data interchange by the <a href="http://dirk.eddelbuettel.com/code/rinside.html" ref="nofollow" target="_blank">RInside</a> package which provides
and easy way of embedding an R instance inside of C++ programs.</p>


<h2>inline use</h2>

<p>Rcpp depends on the <a href="http://cran.r-project.org/web/packages/inline/index.html" ref="nofollow" target="_blank">inline</a> package by Oleg Sklyar et al. Rcpp then uses the
'cfunction' provided by inline (with argument Rcpp=TRUE) to compile, link and
load C++ function from the R session.</p>

<p>As of version 0.8.0 of Rcpp, we also define an R function <a href="http://finzi.psych.upenn.edu/R/library/Rcpp/html/cppfunction.html" ref="nofollow" target="_blank">cppfunction</a> that
acts as a facade function to the <a href="http://finzi.psych.upenn.edu/R/library/inline/html/cfunction.html" ref="nofollow" target="_blank">inline::cfuntion</a>, with specialization for
C++ use.</p>

<p>This allows quick prototyping of compiled code. All our unit tests are based 
on cppfunction and can serve as examples of how to use the mechanism. For example
this function (from the runit.GenericVector.R unit test file) defines from
R a C++ (simplified) version of <a href="http://finzi.psych.upenn.edu/R/library/base/html/lapply.html" ref="nofollow" target="_blank">lapply</a>: </p>

<pre>
  ## create a compiled function cpp_lapply using cppfunction 
  cpp_lapply <- cppfunction(signature(x = "list", g = "function" ), 
  		'Function fun(g) ;
		 List input(x) ;
		 List output( input.size() ) ;
		 std::transform( input.begin(), input.end(), output.begin(), fun ) ;
		 output.names() = input.names() ;
		 return output ;
	    ')
  ## call cpp_lapply on the iris data with the R function summary
  cpp_lapply( iris, summary )	
</pre>

<h2>Using Rcpp in other packages</h2>

<p>Rcpp is designed so that its classes are used from other packages. Using Rcpp
requires :
<ul>
<li>using the header files provided by Rcpp. This is typically done by adding this
   line in the package DESRIPTION file: 
  
<pre>
	LinkingTo: Rcpp
</pre>

  and add the following line in the package code: 
  
<pre>
	#include &lt;Rcpp.h&gt;
</pre>
</li>

<li>linking against the Rcpp dynamic or static library, which is achieved by 
  adding this line to the src/Makevars of the package:
  
<pre>
	PKG_LIBS = $(shell $(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()" )
</pre>

  and this line to the src/Makevars.win file: 
  
<pre>
	PKG_LIBS = $(shell Rscript.exe -e "Rcpp:::LdFlags()")
</pre>
</li>
</ul>

<p>Rcpp contains a function <a href="http://finzi.psych.upenn.edu/R/library/Rcpp/html/Rcpp.package.skeleton.html" ref="nofollow" target="_blank">Rcpp.package.skeleton</a>, modelled after
<a href="http://finzi.psych.upenn.edu/R/library/utils/html/package.skeleton.html" ref="nofollow" target="_blank">package.skeleton</a> from the utils package in base r, that creates a skeleton of
a package using Rcpp, including example code.</p>


<h2> C++ exceptions</h2>

<p>C++ exceptions are R contexts are both based on non local jumps (at least 
on the implementation of exceptions in gcc), so care must be ensure
that one system does not void assumptions of the other. It is therefore 
very strongly recommended that each function using C++ catches 
C++ exceptions. Rcpp offers the function forward_exception_to_r
to facilitate forwarding the exception to the "R side" as an R condition. 
For example : 
</p>

<pre>
  SEXP foo( ) {
    try {
      // user code here
    } catch( std::exception& __ex__){
      forward_exception_to_r( __ex__ ) ;
    }
    // return something here
  }
</pre>

<p>
Alternatively, functions can enclose the user code with the macros <strong>BEGIN_RCPP</strong>
and <strong>END_RCPP</strong>, which provides for a more compact way of programming.  The
function above could be written as follows using the macros:

<pre>
  SEXP foo( ) {
    BEGIN_RCPP
    // user code here
    END_RCPP
    // return something here
  }
</pre>

<p>The use of  <strong>BEGIN_RCPP</strong> and  <strong>END_RCPP</strong> is recommended to anticipate future changes of Rcpp. We might for example decide to install dedicated handlers for specific 
exceptions later.</p>


<h2>Experimental code generation macros</h2>

<p>Rcpp contains several macros that can generate repetitive 'boiler plate' code:</p>

<pre>
  RCPP_FUNCTION_0, ..., RCPP_FUNCTION_65
  RCPP_FUNCTION_VOID_0, ..., RCPP_FUNCTION_VOID_65
  RCPP_XP_METHOD_0, ..., RCPP_XP_METHOD_65
  RCPP_XP_METHOD_CAST_0, ..., RCPP_XP_METHOD_CAST_65
  RCPP_XP_METHOD_VOID_0, ..., RCPP_XP_METHOD_VOID_65
</pre>

<p>For example: </p>

<pre>
  RCPP_FUNCTION_2( int, foobar, int x, int y){
     return x + y ;
  }
</pre>

<p>This will create a <a href="http://finzi.psych.upenn.edu/R/library/base/html/Foreign.html" ref="nofollow" target="_blank">.Call</a> compatible function "foobar" that calls a 
c++ function for which we provide the argument list (int x, int y)
and the return type (int). The macro also encloses the call 
in BEGIN_RCPP/END_RCPP so that exceptions are properly forwarded to R.</p>

<p>Examples of the other macros are given in the NEWS file.</p>

<p><strong>This feature is still experimenta</strong>l, but is being used in packages
<a href="http://romainfrancois.blog.free.fr/index.php?category/R-package/highlight" ref="nofollow" target="_blank">highlight</a> and <a href="http://dirk.eddelbuettel.com/code/rprotobuf.html" ref="nofollow" target="_blank">RProtoBuf</a></p>


<h2>Quality Assurance</h2>

<p>Rcpp uses the <a href="http://sourceforge.net/projects/runit/" ref="nofollow" target="_blank">RUnit</a> package by Matthias Burger et al and the aforementioned
<a href="http://cran.r-project.org/web/packages/inline/index.html" ref="nofollow" target="_blank">inline</a> package by Oleg Sklyar et al to provide unit testing. 
Rcpp currently has over 500 unit tests (called from more than 230 unit test functions) with
very good coverage of the critical parts of the package and library.
</p>

<p>Source code for unit test functions are stored in the unitTests directory 
of the installed package and the results are collected in the "Rcpp-unitTests"
vignette. </p>

<p>The unit tests can be both during the standard R package build and testing
process, and also when the package is installed.  The latter use is helpful
to ensure that no system components have changed in a way that affect the
Rcpp package since it has been installed.  To run the tests, execute
<p>

<pre>
   Rcpp:::test()
</pre>

<p>where an output directory can be provided as an optional first argument.</p>


<h2>Backwards Compatibility</h2>

<p>We believe the new API is now more complete and useful than the previous set
of classes, which we refer to as the "classic Rcpp API". We would therefore
recommend to package authors using 'classic' Rcpp to move to the new API.
However, the classic API is still maintained and will continue to be
maintained to ensure backwards compatibility for code that uses it.
</p>

<p>Packages uses the 'Classic API' can use features of the new API selectively
and in incremental steps. This provides for a non-disruptive upgrade path.</p>


<h2>Documentation</h2>

The package contains a vignette which provides a short and succinct
introduction to the Rcpp package along with several motivating examples.
Also provided is a vignette containing the regression test summary from
the time the package was built.


<h2>Links</h2>

<ul>
<li>
Rcpp main page: <a href="http://dirk.eddelbuettel.com/code/rcpp.html" ref="nofollow" target="_blank">http://dirk.eddelbuettel.com/code/rcpp.html</a>
</li>
<li>R-forge project page: <a href="http://r-forge.r-project.org/projects/rcpp/" ref="nofollow" target="_blank">http://r-forge.r-project.org/projects/rcpp/</a></li>
<li>Dirk's blog section about Rcpp: <a href="http://dirk.eddelbuettel.com/blog/code/rcpp/" ref="nofollow" target="_blank">http://dirk.eddelbuettel.com/blog/code/rcpp/</a></li>
<li>Romain's blog section about Rcpp: <a href="http://romainfrancois.blog.free.fr/index.php?category/R-package/Rcpp" ref="nofollow" target="_blank">http://romainfrancois.blog.free.fr/index.php?category/R-package/Rcpp</a></li>
</ul>


<h2> Support</h2>

<p>Questions about Rcpp should be directed to the <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" ref="nofollow" target="_blank">Rcpp-devel</a> mailing list
</p>

<pre>
 -- Dirk Eddelbuettel and Romain Francois
    Chicago, IL, USA, and Montpellier, France
	May 2010
</pre>
<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 13px;">
<div style="text-align: center;">To <strong>leave a comment</strong> for the author, please follow the link and comment on his blog: <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/05/17/Rcpp-0.8.0"> Romain Francois, Professional R Enthusiast</a></strong>.</div>
<hr />
<a href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: visualization (<a title="ggplot and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" href="http://www.r-bloggers.com/?s=time+series">time series</a>,<a title="ecdf" href="http://www.r-bloggers.com/?s=ecdf">ecdf</a>, <a title="finance trading" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
</div></p>]]></content:encoded>
			<wfw:commentRss>http://www.r-bloggers.com/rcpp-0-8-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rcpp 0.7.7</title>
		<link>http://www.r-bloggers.com/rcpp-0-7-7-2/</link>
		<comments>http://www.r-bloggers.com/rcpp-0-7-7-2/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 21:11:00 +0000</pubDate>
		<dc:creator>romain francois</dc:creator>
				<category><![CDATA[R bloggers]]></category>
		<category><![CDATA[cplusplus]]></category>
		<category><![CDATA[cran]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[Rcpp]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[    
pre{
border: 1px solid black ;
font-size: small ;
}



A good 2 days after 0.7.6 was released, here comes Rcpp 0.7.7. The reason for this release is that a subtle bug installed itself and we did not catch it in time

The new version also includes ...]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 12px;">
(This article was first published on  <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/02/14/Rcpp-0.7.7"> Romain Francois, Professional R Enthusiast</a></strong>, and kindly contributed to <a href="http://www.r-bloggers.com/">R-bloggers)</a>      
</div></p>
    <style>
pre{
border: 1px solid black ;
font-size: small ;
}
</style>


<p>A good 2 days after 0.7.6 was released, here comes <a href="http://dirk.eddelbuettel.com/code/rcpp.html" ref="nofollow" target="_blank">Rcpp</a> 0.7.7. The reason for this release is that a subtle bug installed itself and we did not catch it in time</p>

<p>The new version also includes two new class templates : unary_call and binary_call that help integration of calls (e.g. Rcpp::Language objects) with STL algorithms. For example here is how we might use
unary_call</p>

<iframe src="http://romainfrancois.blog.free.fr/public/packages/Rcpp/unary.html" width=500 height=220></iframe>

<p>This emulates the code</p>

<pre>
> lapply( 1:10, function(n) seq(from=n, to = 0 ) )
</pre>

<p>As usual, more examples in the unit tests</p>
<p class="syndicated-attribution"><div style="border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 13px;">
<div style="text-align: center;">To <strong>leave a comment</strong> for the author, please follow the link and comment on his blog: <strong><a href="http://romainfrancois.blog.free.fr/index.php?post/2010/02/14/Rcpp-0.7.7"> Romain Francois, Professional R Enthusiast</a></strong>.</div>
<hr />
<a href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: visualization (<a title="ggplot and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" href="http://www.r-bloggers.com/?s=time+series">time series</a>,<a title="ecdf" href="http://www.r-bloggers.com/?s=ecdf">ecdf</a>, <a title="finance trading" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
</div></p>]]></content:encoded>
			<wfw:commentRss>http://www.r-bloggers.com/rcpp-0-7-7-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

