[Rcpp-devel] Logic error causes R memory to be corrupt

Dirk Eddelbuettel edd at debian.org
Thu Oct 6 19:36:11 CEST 2016


On 6 October 2016 at 13:12, Anton Bossenbroek wrote:
| The idea behind my code is that I want to create a C++ backend to the
| GeneralTree package I recently committed on CRAN (https://cran.r-project.org/
| web/packages/GeneralTree/index.html ). I have two goals:
| 1. provide a fast and unified interface to xml, JSON, YAML parsers. 
| 2. provide a easy way to handle different models based on the same data using
| decision rules in the tree
| 
| The reason I want to write the backend in C++ is because R6 objects are slow. I
| initially wanted to keep objects by reference to prevent data.frames or entire
| models to be copied, which could be more important in case 2 than 1. What is
| your thought on this?

Everything you get from R is already by reference (well, technically, a
pointer as the P in SEXP). That is the beauty of proxy objects in Rcpp.

So just simplify things, and don't interfere with R's memory management.
Should be much smoother sailing.

I get the feeling that are both very ambitious, yet somewhat new to Rcpp. I
would simply urge patience, recommend you study a couple of existing packages
and start small.

Good luck,  Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list