<!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 <- '<br>
using namespace Rcpp ;<br>
using namespace std ;<br>
int b = as<bool>(xb); <br>
return wrap(b);'<br>
cxxfun <- cxxfunction(sig=signature(xb="logical"),<br>
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>