Re: [R] Formating time in R

2015-10-26 Thread Cacique Samurai
Hello Jean! Thanks very much for your help and assistence! Works very fine! All best, Raoni 2015-10-26 17:02 GMT-02:00 Adams, Jean : > Raoni, > > You could write your own function to do this. For example, using the period > class from the R package lubridate, you could do something like this:

Re: [R] Formating time in R

2015-10-26 Thread Adams, Jean
Raoni, You could write your own function to do this. For example, using the period class from the R package lubridate, you could do something like this: days2 <- function(x) { h1 <- 24*x h <- floor(h1) m1 <- 60*(h1 - h) m <- floor(m1) s <- round(60*(m1 - m)) new_period(second=s, minu

[R] Formating time in R

2015-10-26 Thread Cacique Samurai
Hello R-Helpers! I have a vector of times of events that time is fraction of 1, because it was calculated in excel. Are there some way to format a period greater than 24h in a format like excel [h]:mm:ss? Exemple: test = c(1.424708, 0.028674) > chron (times. = test [2], format = "h:m:S") [1] 00

[R] Formating time in R

2015-10-26 Thread Cacique Samurai
Hello R-Helpers! I have a vector of times of events that time is fraction of 1, because it was calculated in excel. Are there some way to format a period greater than 24h in a format like excel [h]:mm:ss? Exemple: test = c(1.424708, 0.028674) > chron (times. = test [2], format = "h:m:S") [1] 00