title: Getting negative ages using lubridate to calculate age from birth date and current date
body: <p>I have data which looks like this. It is a dataframe containing the date of birth (among other information) for a number of people. </p>
  
  <pre><code>library(tidyr)
  library(dplyr)
  library(magrittr)
  library(lubridate)
  
  df &lt;- data.frame(
  DATE_OF_BIRTH = c("20/10/01" , "15/04/88", "16/12/58", "15/10/91", "09/02/66", "02/07/03", "20/08/96", "22/04/99", "17/04/87", "17/08/56",
                  "28/05/40", "26/07/59", "02/04/65", "17/08/93", "01/08/86", "30/07/01", "03/09/75", "17/09/65", "16/02/95", "11/06/03",
                  "26/10/64", "25/02/73", "07/02/90", "31/03/38", "05/03/83", "10/02/61", "01/07/40", "15/08/51", "19/12/75", "25/11/58",
                  "05/11/81", "05/12/02", "06/05/40", "23/09/69", "17/04/48", "02/07/58", "04/03/98", "26/11/03", "08/01/91", "23/12/07",
                  "05/05/01", "23/10/08", "01/01/09", "29/10/63", "26/03/09", "03/02/75", "03/09/04", "17/01/80", "19/03/11", "05/07/83")
  )
  </code></pre>
  
  <p>What I want to do is calculate the age of each person, based on their date of birth, as of 1st July 2017. </p>
  
  <p>To calculate age I use the following code:</p>
  
  <pre><code>df &lt;- df %&gt;%
  mutate(age = interval(start = dmy(df$DATE_OF_BIRTH), end = dmy('01/07/17')) / 
  duration(num = 1, units = "years"))
  </code></pre>
  
  <p>The output from this is correct for some people, but for others I get a negative value. For these people, their actual age is the absolute value of age <code>abs(age)</code> plus 17. </p>
  
  <p>Can someone tell me how to get only positive values for age? Thanks.</p>
  
  <p>I have seen the following question: <a href="https://stackoverflow.com/questions/31126726/efficient-and-accurate-age-calculation-in-years-months-or-weeks-in-r-given-b">Efficient and accurate age calculation (in years, months, or weeks) in R given birth date and an arbitrary date</a> ,  but this does not include the issue with the negative ages as an output. </p>