[Rcpp-devel] Code for Multiple Inline Call output
Dirk Eddelbuettel
edd at debian.org
Fri Apr 20 23:53:23 CEST 2012
On 20 April 2012 at 23:46, Andrew Shacklock wrote:
| Can someone show the correct syntax to return multiple outputs from an inline
| function call?
| i.e. is it
| return a, b, c
| return ( a, b, c)
| return(0) = a
| return(1) = b
| etc.
| or what?
Well you need valid C++ syntax. This isn't really it.
Also, there are dozens of examples in the Rcpp package, on my blog or in the
list archives. You may want to look at those. Many returns multiple items --
just assign to Rcpp::List and go from there.
And then there are hundreds of unit test example in the (source and binary)
package all of which are also driven by inline.
Dirk
--
R/Finance 2012 Conference on May 11 and 12, 2012 at UIC in Chicago, IL
See agenda, registration details and more at http://www.RinFinance.com
More information about the Rcpp-devel
mailing list