I have a R function that creates a Primebase Cpp Class and then returns a XPtr<Primebase> pointer.
As the construction process takes a significant amount of time I'd like to save the instance of Primebase to my session, so that the next time I open up R I can directly access the Primebase instance.
Unfortunately the underlying Object gets deleted as soon as I close R and the XPtr turns into a null pointer.
Is there a way to prevent R from deleting the object or any other way to save the underlying object?