<div><div dir="auto">There are no scalars in R; there are vectors of length 1. </div></div><div dir="auto"><br></div><div dir="auto"><div><a href="https://stat.ethz.ch/pipermail/r-help/2003-April/032010.html">https://stat.ethz.ch/pipermail/r-help/2003-April/032010.html</a></div><br></div><div dir="auto">Avi</div><div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 10, 2018 at 11:14 AM Wolf Vollprecht <<a href="mailto:w.vollprecht@gmail.com">w.vollprecht@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>What's the canonical way of creating a scalar SEXP in Rcpp? E.g. I would like to store a single numeric / integer / complex ... value. I can create an array with 1 element, but I couldn't find a way to do it for a scalar (and I figured out later that a scalar is *not* the same as a 1element array even though they print the same).<br></div><div><br></div><div>Any pointers?<br></div><div><br></div><div>Thanks, <br></div><div><br></div><div>Wolf<br></div></div>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a></blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Sent from Gmail Mobile</div>