Skip to content
Prev 311566 / 398503 Next

printing difftime summary

Hi,
I am wondering what others do when they want to see a summary of difftime.
cool, thanks.
I now think that what I want is
--8<---------------cut here---------------start------------->8---
difftime.summary <- function (v) {
  s <- summary(as.numeric(v))
  r <- as.data.frame(sapply(s,difftime2string),stringsAsFactors=FALSE)
  names(r) <- c("string")
  r[[units(v)]] <- s
  r
}
string     secs
Min.    500.00 ms      0.5
1st Qu. 17.12 min   1027.0
Median  99.48 min   5969.0
Mean     8.30 hrs  29870.0
3rd Qu.  8.05 hrs  28970.0
Max.    6.98 days 603100.0
--8<---------------cut here---------------end--------------->8---