Skip to content

[Rcpp-devel] DataFrame::create() in endless loop

4 messages · Slava Mazur, Neumann, Steffen, Darren Cook +1 more

#
I had the same problem a while ago and the solution we've come up with was to get rid of Rcpp::DataFrame and use Rcpp::XPtr instead.
It turned out that Rcpp::DataFrame is rather impractical for sufficiently large data sets.
As an alternative, Rcpp::XPtr is a little bit more complex to implement but by far more reliable and efficient.
For more details see this http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2012-January/003335.html and subsequent messages.

Hope this helps.

Cheers,

Slava Mazur

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20120228/be7c911c/attachment-0001.html>
#
Hi,

thanks everyone for the help,
I used IntegerVector and friends, 
and changed from DataFrame to List.

Thanks,
Steffen
On Tue, 2012-02-28 at 14:59 -0500, Slava Mazur wrote:

  
    
#
Hello Steffen,
Do you mean you needed to do both those changes to get it to work? Or
either would have fixed your problem, but you decided to do both "just
in case"?
Slava wrote:
(Ref:
http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2012-January/003345.html
)

XPtr is just for passing a handle to a block of bytes back to R, that it
can then pass back to your C++ code at a later stage, isn't it? I.e. not
a solution if you wanted to manipulate the data in R.
(I'm asking here in case I've misunderstood the scope of its purpose.)

Darren
#
On 29 February 2012 at 08:39, Darren Cook wrote:
| > I used IntegerVector and friends, 
| > and changed from DataFrame to List.
| 
| Hello Steffen,
| Do you mean you needed to do both those changes to get it to work? Or
| either would have fixed your problem, but you decided to do both "just
| in case"?
|
| Slava wrote:
| >> I had the same problem a while ago and the solution we?ve come up with
| >> was to get rid of Rcpp::DataFrame and use Rcpp::XPtr instead.
| (Ref:
| http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2012-January/003345.html
| )
| 
| XPtr is just for passing a handle to a block of bytes back to R, that it
| can then pass back to your C++ code at a later stage, isn't it? I.e. not
| a solution if you wanted to manipulate the data in R.

Correct.

I think the main advantage of working with an IntegerVector is that you may
well save another copy, and dito with List vs DataFrame. Same diligent memory
profiling may reveal more.

Dirk

| (I'm asking here in case I've misunderstood the scope of its purpose.)
| 
| Darren
| 
| 
| -- 
| Darren Cook, Software Researcher/Developer
| 
| http://dcook.org/work/ (About me and my work)
| http://dcook.org/blogs.html (My blogs and articles)
| _______________________________________________
| 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