[Rcpp-devel] returning array from C

Steve Jaffe sjaffe at riskspan.com
Wed Jun 12 04:22:36 CEST 2013


On Tuesday, June 11, 2013 9:21 PM, Krzysztof Sakrejda wrote:

> I think it's more useful to think of whether a limited subset of these 
> operations will work for your application and whether you can convey the limits 
> of the class to the user---I'd hate to convince a user that something _is_ a 
> numeric vector and have them waste hours wondering why some piece of code is not 
> working.

Thanks to everyone for your very helpful comments.

It seems clear there is no easy way to make an object "look like" a numeric vector to R unless it *is* a numeric vector.

>From what I've seen the ff package comes close, but they have indeed reinvented all the necessary R functions (including a package 'ffbase' replicating some significant subset of R 'base')

It was clear from the start that the simplest and safest approach would be to copy the data to R (using Rcpp::wrap). The best alternative, it seems, might be to try converting the data into an ff object. But that's a can of worms which I will leave for another day.

Thanks once again to all those knowledgeable folks who so quickly provided the needed information.

Steve


More information about the Rcpp-devel mailing list