title: Count number of days since a specific date
body: <p>I have got a dataframe with a column Date in which the observations range from 1974-10-01 to 2014-30-09. I would like to create a new column ("Day") in the dataframe which specify the number of day since the first time period day (i.e. 1974-10-01).</p>
  
  <p>I already have the code and it worked perfectly for a really similar dataframe but I do not know why with this 2nd dataframe it does not work.</p>
  
  <p>1) The code is the following:</p>
  
  <pre><code>library(lubridate)
  ref_date &lt;- dmy("01-10-1974")
  df$Day &lt;- as.numeric(difftime(df$Date, ref_date))
  </code></pre>
  
  <p>2) The first rows of my dataframe are:</p>
  
  <pre><code>     Code  Area        Date    Height
  1    2001  551.4 1975-04-01   120.209
  2    2001  551.4 1976-01-06   158.699
  3    2001  551.4 1977-01-21   128.289
  4    2001  551.4 1978-02-23   198.254
  5    2001  551.4 1979-07-31   131.811
  [....]
  </code></pre>
  
  <p>3) What I obtain with my code (1) is the following:</p>
  
  <pre><code>     Code   Area       Date        Day    Height
  1    2001  551.4 1975-04-01   15724800  120.209
  2    2001  551.4 1976-01-06   39916800  158.699
  3    2001  551.4 1977-01-21   72835200  128.289
  4    2001  551.4 1978-02-23  107222400  198.254
  5    2001  551.4 1979-07-31  152409600  131.811
  [....]
  </code></pre>
  
  <p>I spent more than 2 hours wondering why without any clue.</p>
  
  <p>Any suggestion?</p>