title: convert Rcpp::NumericVector to Eigen::VectorXd
body: <p>A similar question has been asked before, here:</p>
  
  <p><a href="https://stackoverflow.com/questions/20435561/converting-between-numericvector-matrix-and-vectorxd-matrixxd-in-rcppeigen-to">Converting between NumericVector/Matrix and VectorXd/MatrixXd in Rcpp(Eigen) to perform Cholesky solve</a></p>
  
  <p>The thing is, the code I found in <em>fastLm.cpp</em> (at the end) does not work for me. </p>
  
  <pre><code>Rcpp::NumericVector X( (SEXP) R.parseEval("x &lt;- 1:10"));
  
  Eigen::Map&lt;Eigen::VectorXd&gt; XS(Rcpp::as&lt;Eigen::Map&lt;Eigen::VectorXd&gt;&gt;(X)); //!!not working
  </code></pre>
  
  <p>It gives the following error:</p>
  
  <pre><code>error: no matching constructor for initialization of 'Eigen::Map&lt;Eigen::Matrix&lt;double, -1, 1, 0, -1, 1&gt;, 0, Eigen::Stride&lt;0, 0&gt; &gt;'
                      Exporter( SEXP x ) : t(x){}
  </code></pre>
  
  <p>and (besides others):</p>
  
  <pre><code>note: candidate constructor (the implicit copy constructor) not viable: cannot convert argument of incomplete type 'SEXP' (aka 'SEXPREC *') to 'const Eigen::Map&lt;Eigen::Matrix&lt;double, -1, 1, 0, -1, 1&gt;, 0, Eigen::Stride&lt;0, 0&gt; &gt;'
  template&lt;typename PlainObjectType, int MapOptions, typename StrideType&gt; class Map
  </code></pre>
  
  <p>It might have something to do with the SEXP object?</p>