steps <-
list("10 secs", "1 min", "5 mins", "30 mins", "6 hours", "12 hours",
"1 DSTday", "2 weeks", "1 month", "6 months", "1 year",
"10 years", "50 years", "1000 years")
names(steps) <- paste("span =", unlist(steps))
x <- as.POSIXct("2002-02-02 02:02")
lapply(steps,
function(s) {
at <- pretty(seq(x, by = s, length = 2), n = 5)
attr(at, "labels")
})
Run the code above in your browser using DataLab