<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div name="quoted-content">
      <div style="font-family: Verdana;font-size: 12.0px;">
        <div>Dear all,</div>
        <div> </div>
        <div>I am trying to use Rcpp to write some files in C++ for use
          in R.</div>
        <div> </div>
        <div>Below is an example for a cpp-file (crossp.cpp). Then I use
          >sourceCpp("crossp.cpp") in R and the corresponding
          function is availabe in R.</div>
        <div>Now I have to question related to this worklfow:</div>
        <div>1) Is there a way to see the source file of the "final"
          cpp-file? (I mean is it possible to see how the //-lines are
          replaced and what soureCpp does?)</div>
        <div>2) (Connected with the first question) Up to now, I am
          working in R Studio, but I would  prefer an IDE (e.g. NetBeans
          IDE). But when I compile the cpp-file there,  the following
          message shows up:</div>
        <div> </div>
        <div>In file included from
          /R/win-library/3.0/RcppArmadillo/include/RcppArmadilloForward.h:28:0,<br>
                           from
          /R/win-library/3.0/RcppArmadillo/include/RcppArmadillo.h:30,<br>
                           from crossp.cpp:1:<br>
          /R/win-library/3.0/RcppArmadillo/include/RcppArmadilloConfig.h:90:35:

          fatal error: RcppArmadilloLapack.h: No such file or directory<br>
             #include <RcppArmadilloLapack.h></div>
        <div> </div>
        <div>Is there an way to compile the file without sourCpp but in
          an IDE? What do I have to change?</div>
        <div> </div>
        <div>As I am starting to work with Rcpp my question might sound
          silly, but any help and comments are highly welcome.</div>
        <div> </div>
        <div>Thank you very much for your help in advance!</div>
        <div> </div>
        <div>Best,</div>
        <div> </div>
        <div>Martin</div>
        <div> </div>
        <div>crossp.cpp:</div>
        <div> </div>
        <div>
          <div>#include <RcppArmadillo.h><br>
            // [[Rcpp::depends(RcppArmadillo)]]</div>
          <div>using namespace Rcpp;<br>
            using namespace arma;</div>
          <div>//[[Rcpp::export]]</div>
          <div>NumericMatrix crossp3(NumericMatrix Xr) {<br>
              int n = Xr.nrow(), k = Xr.ncol();<br>
              arma::mat X(Xr.begin(), n, k, false); <br>
              arma::mat XXt = X.t()*X;<br>
              return Rcpp::wrap(XXt);<br>
            }</div>
        </div>
      </div>
    </div>
    <div class="moz-forward-container"><br>
    </div>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
********************************************************
Dr. Martin Spindler
Senior Researcher
Max Planck Society
Munich Center for the Economics of Aging
Amalienstr. 33
80799 Munich
Germany</pre>
  </body>
</html>