Re: [Rd] Holding a large number of SEXPs in C++

2014-11-03 Thread Simon Urbanek
On Nov 3, 2014, at 5:34 PM, Simon Knapp wrote: > Thanks again Simon. I had realised that R_NilValue didn't need protection... > I just thought it a clean way to make my initial call to PROTECT_WITH_INDEX > (which I can see now was not required since I didn't need the calls to > REPROTECT)...

Re: [Rd] Holding a large number of SEXPs in C++

2014-11-03 Thread Simon Knapp
Thanks again Simon. I had realised that R_NilValue didn't need protection... I just thought it a clean way to make my initial call to PROTECT_WITH_INDEX (which I can see now was not required since I didn't need the calls to REPROTECT)... and I had not thought of appending to the tail. One final qu

Re: [Rd] Holding a large number of SEXPs in C++

2014-11-03 Thread Simon Urbanek
On Nov 2, 2014, at 10:55 PM, Simon Knapp wrote: > Thanks Simon and sorry for taking so long to give this a go. I had thought of > pair lists but got confused about how to protect the top level object only, > as it seems that appending requires creating a new "top-level object". The > followin

Re: [Rd] Holding a large number of SEXPs in C++

2014-11-02 Thread Simon Knapp
Thanks Simon and sorry for taking so long to give this a go. I had thought of pair lists but got confused about how to protect the top level object only, as it seems that appending requires creating a new "top-level object". The following example seems to work (full example at https://gist.github.c

Re: [Rd] Holding a large number of SEXPs in C++

2014-10-17 Thread Simon Urbanek
On Oct 17, 2014, at 7:31 AM, Simon Knapp wrote: > Background: > I have an algorithm which produces a large number of small polygons (of the > spatial kind) which I would like to use within R using objects from sp. I > can't predict the exact number of polygons a-priori, the polygons will be > gr

[Rd] Holding a large number of SEXPs in C++

2014-10-17 Thread Simon Knapp
Background: I have an algorithm which produces a large number of small polygons (of the spatial kind) which I would like to use within R using objects from sp. I can't predict the exact number of polygons a-priori, the polygons will be grouped into regions, and each region will be filled sequential