Thanks for the reply, Xian.<br><br>The quick reference is quite helpful. Most of the time, I use &#39;inline&#39; to create R functions and I think &#39;inline&#39; includes Rcpp.h which specifies the namespace Rcpp.<br>Very often I will need Armadillo and will be &quot;using namespace arma;&quot;. Maybe I should keep using arma:: too, according to Darren&#39;s advice.<br>
<br>Zhongyi<br><br><div class="gmail_quote">On Wed, Aug 31, 2011 at 6:05 AM, Christian Gunning <span dir="ltr">&lt;<a href="mailto:xian@unm.edu">xian@unm.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Wed, Aug 31, 2011 at 3:00 AM,<br>
&lt;<a href="mailto:rcpp-devel-request@r-forge.wu-wien.ac.at">rcpp-devel-request@r-forge.wu-wien.ac.at</a>&gt; wrote:<br>
&gt;<br>
&gt; Rcpp::NumericVector x = as&lt;Rcpp::NumericVector&gt;(x_);<br>
&gt; std::vector&lt;double&gt; x = as&lt; std::vector&lt;double&gt; &gt;(x_);<br>
<br>
</div>Nice clarification of what&#39;s going on under the hood, Darren.<br>
For the first case, the above is synonymous with:<br>
<br>
  Rcpp::NumericVector x(x_);<br>
<br>
If you want a deep copy, you can use:<br>
<br>
  Rcpp::NumericVector x(clone(x_));<br>
<br>
See the quickref pdf for examples<br>
(<a href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-quickref.pdf%29.." target="_blank">http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-quickref.pdf)..</a>..<br>
there, &quot;using namespace Rcpp;&quot; is implied throughout unless otherwise<br>
noted.<br>
<br>
-xian<br>
<font color="#888888"><br>
--<br>
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal – Panama!<br>
</font></blockquote></div><br>