title: Storing C objects in R
body: <p>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:</p>
  
  <ul>
  <li>initialize a Foo object.  I don't want to have to store one of these in terms of R's lists or matrices.  </li>
  <li>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.</li>
  <li>remove the Foo object from memory.</li>
  </ul>
  
  <p>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.</p>
  
  <p>Thanks in advance for any advice.</p>