title: Ignore missing values while finding min in Rcpp
body: <p>I am trying to find the minimum of 2 values from 2 vectors in Rcpp. But the following does not compile:</p>
  <pre><code>#include &lt;cmath&gt;
  #include &lt;Rcpp.h&gt;
  using namespace Rcpp;
  
  
  
  // [[Rcpp::export]]
  NumericVector timesTwo(int time_length, double BXadd, 
                         NumericVector vn_complete, NumericVector vn1_complete) {
    
    // Empty vectors
    NumericVector BX (time_length);
    
    for(int t = 0; t &lt; time_length; t++) {
  
      BX[t] = BXadd * sqrt(std::min(na_omit(vn_complete[t], vn1_complete[t])));
      
    }
  
    return BX;
    
    // return vn_complete[0];
  }
  
    Error 1 occurred building shared library.
  </code></pre>
  <p>It works if I don't use <code>na_omit</code>.</p>
  <h3>R code for running the function:</h3>
  <pre><code>Rcpp::sourceCpp(&quot;test.cpp&quot;)
  
  timesTwo(5, 2, 5:9, 1:5)
  </code></pre>