Tengo un dato con más de 3 millones de registros que tienen start.time y end.time como dos de las variables. Los primeros 10 obs son los siguientes:calculando la diferencia de tiempo en R
start.date start.time end.date end.time
1 2012-07-13 15:01:32 2012-07-13 15:02:42
2 2012-07-05 18:26:31 2012-07-05 18:27:19
3 2012-07-14 20:23:21 2012-07-14 20:24:11
4 2012-07-29 16:09:54 2012-07-29 16:10:48
5 2012-07-21 14:58:32 2012-07-21 15:00:17
6 2012-07-04 15:36:31 2012-07-04 15:37:11
7 2012-07-22 18:28:31 2012-07-22 18:28:50
8 2012-07-09 21:08:42 2012-07-09 21:09:02
9 2012-07-05 09:44:52 2012-07-05 09:45:05
10 2012-07-02 18:50:47 2012-07-02 18:51:38
Necesito calcular la diferencia entre start.time y end.time.
He utilizado el siguiente código:
mbehave11$diff.time <- difftime(mbehave11$end.time, mbehave11$start.time, units="secs")
Pero estoy recibiendo este error:
Error in as.POSIXlt.character(x, tz, ...) :
character string is not in a standard unambiguous format
In addition: Warning messages:
1: In is.na.POSIXlt(strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz)) :
Reached total allocation of 1535Mb: see help(memory.size)
¿Puede proporcionar un ejemplo reproducible? Puede leer esto para obtener más información al respecto: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Dason