title: Header names as dates in r
body: <p>I'm trying to calculate the "death" of users, meaning I want to determine the time duration between when a user signs up for a program and when they are no longer active in the program. I have two files which I read in using <code>read.csv("filename",header=TRUE)</code>:</p>
  
  <pre><code> &gt;   df
        name   start.date
  1  Allison   2013-03-16
  2   Andrew   2013-03-16
  3     Carl   2013-03-16
  4     Dora   2013-03-17
  5   Hilary   2013-03-17
  6    Louis   2013-03-19
  7     Mary   2013-03-20
  8   Mickey   2013-03-20
  </code></pre>
  
  <p>And file 2:</p>
  
  <pre><code>&gt; df2
         names X04.16.2013 X04.17.2013 X04.18.2014  X04.19.2013
  2001 Allison           5           5           0           0
  2002  Andrew           0           0           0           0
  2003    Carl           8           8           11          10
  2004    Dora           6           4           9           3
  2005  Hilary           2           0           0           0
  2006   Louis           18         10           8           3
  2007    Mary           4           7           7           0
  2008  Mickey           9           5           0           0
  </code></pre>
  
  <p>What I would like to do is convert the header names of df2 to dates, so I can then create a new data frame that has the user names, start date, and "days to death", which would be when a user has an entry of 0 in df2:</p>
  
  <pre><code>      name   start.date   days.to.death
  1  Allison   2013-03-16   33
  2   Andrew   2013-03-16   0
  3     Carl   2013-03-16   NA
  4     Dora   2013-03-17   NA
  5   Hilary   2013-03-17   31
  6    Louis   2013-03-19   NA
  7     Mary   2013-03-20   30
  8   Mickey   2013-03-20   28
  </code></pre>
  
  <p>Note that Andrew was never "alive" and Carl, Dora, and Louis haven't "died" yet. I'm still rather new to R so any input is much appreciated!</p>