title: converting double * to std::vector<double> gives me error
body: <p>I have seen other posts regarding this issue. I followed them. </p>
  
  <p>The code I am using to convert a double array to a double vector is- </p>
  
  <pre><code>cppFunction("
  
  
               std::vector&lt;double&gt; ArrayToVector(double *arr){
  
                 std::vector&lt;double&gt; vec(arr, arr+ sizeof(arr)/sizeof(arr[0]));
  
                return vec;
               }
  
  
  
              ")
  </code></pre>
  
  <p>But I am getting this error: </p>
  
  <pre><code>file52e20f14d34.cpp:28:52: error: cannot initialize a variable of type 'Rcpp::traits::input_parameter&lt;double&gt;::type *' (aka 'InputParameter&lt;double&gt; *') with an lvalue of type 'SEXP' (aka 'SEXPREC *')
      Rcpp::traits::input_parameter&lt; double &gt;::type *arr(*arrSEXP);
                                                     ^   ~~~~~~~~
  1 error generated.
  make: *** [file52e20f14d34.o] Error 1
  clang++  -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/private/var/folders/4w/v4pl36r9475cb2fkspc3qxkm0000gp/T/RtmpSXqByM/sourceCpp-x86_64-apple-darwin15.6.0-1.0.1" -I/usr/local/include   -fPIC  -Wall -g -O2  -c file52e20f14d34.cpp -o file52e20f14d34.o
  Error in sourceCpp(code = code, env = env, rebuild = rebuild, cacheDir = cacheDir,  : 
    Error 1 occurred building shared library.
  </code></pre>
  
  <p>Can anyone explain me why this is happening? Any help would be much appreciated.</p>