[Rcpp-devel] Dynamic Wrapping and Recursion with Rcpp - using an R function?

Krzysztof Sakrejda krzysztof.sakrejda at gmail.com
Fri Jul 26 23:06:55 CEST 2013


Make the wrapper a reference class which has a field for the data.
When the wrapper is initialized, pass the data as an argument and it
will be copied when the initialize method runs. Works in my project...
or am I missing something here?

Krzysztof

On Fri, Jul 26, 2013 at 4:58 PM, Tal Galili <tal.galili at gmail.com> wrote:
> Hi Hadley,
>
> Regarding the cloning of the object in C++: since I will want to use the
> function recursively, I will either have the cloning in the wrapper R
> function. And if I discover that is not possible (I haven't tried it yet),
> my next thought was to split the work into two functions, in one there will
> be the cloning, and the other will do the recursion.
> Since the example I gave in the first e-mail doesn't work (help is
> welcomed), I am not there yet :)
>
> As for as.dendrogram, that is the case with hclust object. However, these
> objects has limitations when it comes to trees which are NOT binary trees.
> So one of the things I started doing with dendextend is to create various
> functions that will work for non-binary trees (which I previously had to
> work with).
>
> Tal
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ----------------Contact
> Details:-------------------------------------------------------
> Contact me: Tal.Galili at gmail.com |
> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
> www.r-statistics.com (English)
> ----------------------------------------------------------------------------------------------
>
>
>
> On Fri, Jul 26, 2013 at 7:07 PM, Hadley Wickham <h.wickham at gmail.com> wrote:
>>
>> > I understand your point, and am not sure how to proceed without it.
>>
>> Just make sure you clone the initial list once, or use another C++
>> data structure (e.g. std::vector) that can grow efficiently.
>>
>> Alternatively, you could create your own alternative to as.dendrogram
>> that doesn't create a hierarchical structure.  (That's what I'd try
>> first)
>>
>> Hadley
>>
>> --
>> Chief Scientist, RStudio
>> http://had.co.nz/
>
>
>
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel



-- 

Krzysztof Sakrejda

Organismic and Evolutionary Biology
University of Massachusetts, Amherst
319 Morrill Science Center South
611 N. Pleasant Street
Amherst, MA 01003

work #: 413-325-6555
email: sakrejda at cns.umass.edu
-----------------------------------------------


More information about the Rcpp-devel mailing list