title: R - convert POSIXct to fraction of julian day
body: <p>How can a date/time object in R be transformed on the fraction of a julian day?</p>
  
  <p>For example, how can I turn this date:</p>
  
  <pre><code>date &lt;- as.POSIXct('2006-12-12 12:00:00',tz='GMT')
  </code></pre>
  
  <p>into a number like this</p>
  
  <pre><code>&gt; fjday
  [1] 365.5
  </code></pre>
  
  <p>where julian day is elapsed day counted from the january 1st. The fraction 0.5 means that it's 12pm, and therefore half of the day.</p>
  
  <p>This is just an example, but my real data covers all the 365 days of year 2006.</p>