21
In the R Extensions manual, I found information about accessing R objects from C. In my situation, however, I am working with somebody else's C code which has a specialized data structure (call it Foo). My goal is to have R functions that:
- initialize a Foo object. I don't want to have to store one of these in terms of R's lists or matrices.
- update a Foo object. I don't want to have to recreate the Foo object to do this, but rather modify it in place. Also, this function might return information about whether the update was successful.
- remove the Foo object from memory.
In other words, I would like to keep around a C object in an R environment, using R functions (backed by C functions) to create it, modify it, and delete it.
Thanks in advance for any advice.