Time conversion to number

Viewed 66

There is a vector with a time value. How can I remove a colon and convert a text value to a numeric value. i.e. from "10:01:02" - character to 100102 - numeric. All that I could find is presented below.

> x <- c("10:01:02", "11:01:02")  
> strsplit(x, split = ":")
[[1]]
[1] "10" "01" "02"

[[2]]
[1] "11" "01" "02"
3 Answers
Related