title: R: coerce 'externalptr' into character
body: <p>I am debugging parallel code that uses Rhpc package.  Rhpc stores the
  cluster data into an <code>externlaptr</code> objects.  I want to test if it
  is not corrupt, and hence somehow output it's value into a file by
  <code>write</code>.</p>
  
  <p>The code looks like this:</p>
  
  <pre><code>library(Rhpc)
  Rhpc_initialize()
  cl &lt;- Rhpc_getHandle(1)
  print(cl)
  </code></pre>
  
  <p><code>print</code> works, but is there a way to convert it into a
  <code>character</code> object to be outputted with <code>write()</code>?
  <code>as.character</code>, <code>as(cl, "character")</code>, <code>as(cl, "integer")</code>
  etc give an error <code>cannot coerce type 'externalptr' to vector of
  type 'character'</code></p>