It seems that the error is the format string passed to as.Date
. It specifies -
characters, but you're using /
characters in the actual input.
The easiest way to do the desired operation, is to use paste
on the columns themselves, then pass to as.POSIXlt
with an appropriate format string:
with(data1, as.POSIXlt(paste(Date, Time), format="%d/%m/%y %H:%M:%S"))
## [1] "2014-04-10 00:00:00" "2014-04-10 00:04:30" "2014-04-10 00:09:00"