First, thank you to the Rcpp team for their work on Rcpp. It's an incredible resource to get C++ code executing from R.
<div><br></div><div>I've worked through setting up the correct development environment (Ian Fellow's post on Eclipse + Rcpp was great with a few tweaks for a Linux install) as well some of the examples. The next step I'd like to take is develop some prototype code for implementing an individual-based simulation.</div>
<div><br></div><div>Let's say I have a function that creates the simulated population based on some number of input parameters:</div><div><br></div><div>RcppExport SEXP CreatePopulation( /* some amount of input parameters*/ );</div>
<br class="Apple-interchange-newline"><div>I would then want other functions called in R via Rcpp to operate on the population or return specific results. The part I'm struggling with is how would the population state persist when created in CreatePopulation to be then access/modified in other functions. My initial though is to have some sort of population object, however I don't know how this would persist when the code returns from execution in C++. R can't store a C++ object to be passed back, correct? Could I just create a global object within C++?</div>
<br class="Apple-interchange-newline"><div>Any feedback would be appreciated,</div><div>Andy</div>