title: R apply function returns numeric value on date variables
body: <p>I have a R dataframe which have sequence of dates. I want to create a dataframe from the existing one which consists of one month prior dates. 
  For example let x be the initial dataframe</p>
  
  <pre><code>x = data.frame(dt = c("28/02/2000","29/02/2000","1/03/2000","02/03/2000"))
  </code></pre>
  
  <p>My required dataframe y would be </p>
  
  <pre><code>y = c("28/01/2000","29/01/2000","1/02/2000","02/02/2000")
  </code></pre>
  
  <p>The list is quite big so I don't want looping. I have created a inline function which works fine when I give individual dates. </p>
  
  <pre><code>datefun &lt;- function(x) seq(as.Date(strptime(x,format = "%d/%m/%Y")), length =2, by = "-1 month")[2]
  
  datefun("28/02/2000") gives "28/01/2000" as an output
  </code></pre>
  
  <p>But while I use it inside R apply it gives random numerical values. </p>
  
  <pre><code>apply(x,1,function(x) datefun(x))
  </code></pre>
  
  <p>The output for this is </p>
  
  <pre><code>[1] 10984 10985 10988 10989
  </code></pre>
  
  <p>I don't know from where these numbers are getting generated, am I missing something. </p>