Hi,
I have a data frame where one of the columns contain time(HH:MM:SS) and of character format.
I am trying to convert it into minutes to make further calculations easy.
I have a function like this to do it by doing matrix multiplication.
time2sec <- function(x) {
c(as.matrix(read.table(text = x, sep = ":")) %*% c(3600, 60, 1))
}
My original DF is huge with 1698572 rows .
So i create a subset like this to try
subDF <- head(cleanDF,100)
subDF <- transform(subDF, ride_time_in_minutes = time2sec(ride_length)/60)
It works beautifully with a new column 'ride_time_in_minutes' of num datatype.
But when i try it on the entire DF , it fails with the message
arguments imply differing number of rows: 1698572, 1697551
I have already checked for null values and o s and the row numbers are also consistent in the original set.
Confused how to proceed to debug.
Any idea what goes wrong??
Thanks in advance !!!