title: R: How to convert double to raw and back?
body: <p>There a <code>as.raw</code> function and <code>intToBits</code> function.</p>
  
  <p>So I can convert a <code>double</code> to bits but how do I convert it back to <code>double</code>.</p>
  
  <p>The use case is convert <code>double</code> to <code>raw</code> so I can compress with <code>fst::compress_fst</code>, then write it to disk using <code>writeBin</code>, then read it back. But because I can't find a way to convert <code>raw</code> back to <code>double</code>, this seems impossible at the moment.</p>
  
  <p>To convert <code>integer</code> to raw and back, is <code>packBits(intToBits(1:10), type = "integer")</code>. What's the equivalent for double?</p>