Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HoraDecimal <- function(x){
- sum(unlist(lapply(strsplit(x, split=":"), as.numeric)) * c(1, 1/60, 1/3600))
- }
- x <- "02:20:00"
- HoraDecimal(x)
- [1] 2.333333
- y <- "00:50:00"
- HoraDecimal(y)
- [1] 0.8333333
- z <- "3:30:30"
- HoraDecimal(z)
- [1] 3.508333
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement