title: Combine day,month,year,hour to date time in R
body: <pre><code>day   month     year    hour
  01     05      2017     00
  05     12      2017     01
  10     07      2017     23
  </code></pre>
  
  <p>i don't have column minute and seconds now i am trying to get a single variable as date_time in the format of </p>
  
  <pre><code>2017-05-01 00:00:00
  2017-12-05 01:00:00
  2017-07-10 23:00:00
  </code></pre>
  
  <p>getting the error while using the below code</p>
  
  <pre><code>df$date &lt;- as.Date(with(df, paste(year, month, day,hour,sep="-")),
             "%Y-%m-%d %H:%M:%S") 
  </code></pre>
  
  <p>thanks in advance</p>