I am using this code to calculate time difference.
ctym <- lapply(G, function(x) x[k,2])
y <- lapply(G, function(x) x[j,2])
t1 <- c(y,ctym)
dt1 <- as.POSIXct(t1)
dtyme <- difftime(dt1[2],dt1[1],units = "mins")
Output for t1 is:
[[1]]
time_occurred
"2013-04-01 20:27:18"
[[2]]
time_occurred
"2013-04-01 20:27:48"
Error I am getting is: Error in as.POSIXct.default(t1) : do not know how to convert 't1' to class “POSIXct”
What's wrong here?