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