Is there a way to convert mm:ss.00 to seconds.00?

前端 未结 6 1778
离开以前
离开以前 2020-12-30 03:12

I\'ve got some performance time data in mm:ss.00 format (i.e. 02:15.45, or 00:34.58). R is recognizing the variable as a factor, but I\'d like to convert each performance t

6条回答
  •  不知归路
    2020-12-30 03:52

    library(lubridate)
    df$variable<- hms(df$variable)
    df$variable<- as.numeric(df$variable)
    

    make it a one-liner is ok as well. Works like a charm for me.
    I hope this helps.

提交回复
热议问题