<html><body bgcolor="#FFFFFF"><div>Yes. LogicalVector.<br><br><div><br></div></div><div><br>Le 14 avr. 2011 à 05:00 PM, Cedric Ginestet <<a href="mailto:c.ginestet05@googlemail.com">c.ginestet05@googlemail.com</a>> a écrit :<br><br></div><div></div><blockquote type="cite"><div>
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>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Rcpp-devel mailing list</span><br><span><a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a></span><br><span><a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a></span><br></div></blockquote></body></html>