Hey All,

I want to standardize my timestamp which is formatted as hh:mm:ss

 My data looks like this:

     Date     Time
01/01/2013 00:09:01
01/02/2013 00:10:14
01/03/2013 00:11:27
01/04/2013 00:12:40
01/05/2013 00:13:53
01/06/2013 00:15:06
01/07/2013 00:16:19
01/08/2013 00:17:32
01/09/2013 00:18:45
01/10/2013 00:19:58

Dataset <- structure(list(Date = c("01/01/2013", "01/02/2013",
"01/03/2013",
"01/04/2013", "01/05/2013", "01/06/2013", "01/07/2013", "01/08/2013",
"01/09/2013", "01/10/2013"), Time = c("00:09:01", "00:10:14",
"00:11:27", "00:12:40", "00:13:53", "00:15:06", "00:16:19", "00:17:32",
"00:18:45", "00:19:58")), .Names = c("Date", "Time"), class = "data.frame",
row.names = c(NA,
-10L))

I would like to change all the records in "Time" column uniformed as
hh:mm:00, then the output would be this:

Date     Time
01/01/2013 00:09:00
01/02/2013 00:10:00
01/03/2013 00:11:00
01/04/2013 00:12:00
01/05/2013 00:13:00
01/06/2013 00:15:00
01/07/2013 00:16:00
01/08/2013 00:17:00
01/09/2013 00:18:00
01/10/2013 00:19:00

Thanks for your help!

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to