On 10 December 2018 at 11:24, Avraham Adler wrote:
| There are no scalars in R; there are vectors of length 1.
Yep. An R feature, and gotcha if you come from somwhere else. See
R> a <- 1
R> is.vector(a)
[1] TRUE
R>
And while we can do this
R> Rcpp::cppFunction("double wolf(double x) { return x+x; }")
R> wolf(21.0)
[1] 42
R>
it involves a combination of casts and our template magic so make it SEXPs
which, as representations of R types, are always vectors.
Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | [email protected]
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel