How to convert R date to a number for a given origin date?
<p>I want to convert a date to number of days from <code>00-01-0000</code> (it's an MATLAB's origin).</p>

<p>e.g.</p>

<pre><code>dt_str &lt;- '2016-05-20'
dt &lt;- as.Date(dt_str)
dt_num &lt;- SOME_FUNCTION(dt, origin = '0000-01-01')
</code></pre>

<p>I am unable to use <code>as.Date.numeric()</code>.</p>