I have seen a couple of ways of creating an instance of a C++ class
exported in a module
mod <- Module("myMod", "myPackage")
cls <- mod$myClass
inst <- cls$new(constructorArgs)
and
inst <- new(mod$myClass, constructorArgs)
Is one of these the preferred way?
_
I'd say up to you. I prefer the new( Class , ... ) construct.
Also, with Rcpp 0.8.9 with populate, you dont need to use the $ so much.
You can, in your .onLoad call populate once and then just use the class. See
the Rcpp-modules vignette.
Romain
Le 30 nov. 2010 à 05:21 PM, Douglas Bates
On Tue, Nov 30, 2010 at 10:31 AM, wrote:
> I'd say up to you. I prefer the new( Class , ... ) construct.
>
> Also, with Rcpp 0.8.9 with populate, you dont need to use the $ so much.
>
> You can, in your .onLoad call populate once and then just use the class. See
> the Rcpp-modules vignette.
Is
Le 30 nov. 2010 à 06:01 PM, Douglas Bates a écrit :
> On Tue, Nov 30, 2010 at 10:31 AM, wrote:
>> I'd say up to you. I prefer the new( Class , ... ) construct.
>>
>> Also, with Rcpp 0.8.9 with populate, you dont need to use the $ so much.
>>
>> You can, in your .onLoad call populate once
The Rcpp (and RInside) documentation attempts to make it clear that the set
of supported compilers is definied by R Core via the support in R and its
tools.
Rcpp is first and foremost an extension package for R, it does not live by
itself out there in the wild. So useful compilers are the ones