Skip to content
Prev 300218 / 398503 Next

histogram of time-stamp data

Hello,

Try the following.


timestamps <- as.POSIXct(Sys.Date()) + sample(24*60*60, 1e3, TRUE)

h1 <- cut(timestamps, breaks="hour")
h2 <- cut(timestamps, breaks="15 mins")

op <- par(mfrow=c(1, 2))
hist(as.integer(h1))
hist(as.integer(h2))
par(op)


Hope this helps,

Rui Barradas

Em 16-07-2012 09:47, e-letter escreveu: