title: Error when building R package using roxygen2
body: <p>I have 2 files, Rfile.R and Cppfile.cpp.</p>
  
  <p>Contents in Cppfile.cpp:</p>
  
  <pre><code>#include &lt;Rcpp.h&gt;
  using namespace Rcpp;
  // [[Rcpp::export]]
  int CPPF(int k){return ++k;}
  </code></pre>
  
  <p>Contents in Rfile.R:</p>
  
  <pre><code>RF&lt;-function(k){return(CPPF(k))}
  </code></pre>
  
  <p>I want to build an R package based on the 2 files. I use the lastest versions of Rstudio and Roxygen2.</p>
  
  <p>I tried 3 ways to build the package with or without Roxygen2, and had different results:</p>
  
  <ol>
  <li><p>New Project->New Directory->R package->Type:Package w/Rcpp, add both Rfile.R and Cppfile.cpp as source files. Build &amp; reload, everything works out fine. The functions work as they do.</p></li>
  <li><p>New Project->New Directory->R package->Type:Package w/Rcpp, add both Rfile.R and Cppfile.cpp as source files. Select "Generate documentations with Roxygen", check all its options. Build &amp; Reload, the functions don't work. Inputting "RF" gives the contents of RF, inputting "CPPF" pops "Object not found".</p></li>
  <li><p>New Project->New Directory->R package->Type:Package w/Rcpp, add only Cppfile.cpp as source files. Select "Generate documentations with Roxygen", check all its options. Build &amp; Reload, the function works. 
  Then copy Rfile.R directly into the project folder->R folder. Build &amp; Reload, everything fine, functions work well.</p></li>
  </ol>
  
  <p>Am I using the Roxygen wrong or Roxygen has bugs? I need it to document. I can stick to the 3rd way which cost me much energy to find, but wired. </p>
  
  <p>Thanks!</p>
  
  <p>One Way To Solve The Issue:
  When selecting "Generate documentations with Roxygen", Don't check "NAMESPACE file" option.</p>