Convert column format to YYYY-MM-DD HH:MM:SS

Hey, I am converting ds column into this format YYYY-MM-DD HH:MM:SS. I want to do this in such a way that time in the columns does not change to 00:00:00.

by this code:

df = data
df$ds <- format(as.POSIXct(as.numeric(as.character(df$ds), "%Y%m%d%H%M%S")))

Its says:
Warning message:

In as.POSIXct(as.numeric(as.character(df$ds), "%Y%m%d%H%M%S")) :
NAs introduced by coercion

Data sample:

ds y
07/01/2015 1:00 5244
07/01/2015 2:00 5152
07/01/2015 3:00 4948
07/01/2015 4:00 4485
07/01/2015 5:00 4231
07/01/2015 6:00 4158
07/01/2015 7:00 4324
07/01/2015 8:00 4686
07/01/2015 9:00 5060
07/01/2015 10:00 5347

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.