<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hi all, <br>
    <br>
    I am trying to pass on a boolean vector from R to C++. I have
    naively tried the following: <br>
    <br>
    ################################<br>
    src &lt;- '<br>
    &nbsp; using namespace Rcpp ;<br>
    &nbsp; using namespace std ;<br>
    &nbsp; int b = as&lt;bool&gt;(xb); <br>
    return wrap(b);'<br>
    cxxfun &lt;- cxxfunction(sig=signature(xb="logical"),<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; body=src,plugin="Rcpp",verbose=TRUE)<br>
    cxxfun(b);<br>
    <br>
    Error in cxxfun(b) : expecting a single value<br>
    ###############################<br>
    <br>
    Is there an equivalent to IntegerVector or NumericVector for Boolean
    variables or can I simply use the Rcpp::Vector template for this
    purpose? <br>
    <br>
    Thanks for your help,<br>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      <div class="moz-signature"><font face="Times" size="3"> Cedric
          Ginestet <br>
          Centre for Neuroimaging Sciences (L3.04) <br>
          NIHR Biomedical Research Centre <br>
          Department of Neuroimaging <br>
          Institute of Psychiatry, Box P089 <br>
          King's College London <br>
          De Crespigny Park<br>
          London <br>
          SE5 8AF <br>
        </font> </div>
    </div>
  </body>
</html>