# NOT RUN {
(today <- Sys.Date())
format(today, "%d %b %Y") # with month as a word
(tenweeks <- seq(today, length.out=10, by="1 week")) # next ten weeks
weekdays(today)
months(tenweeks)
# }
# NOT RUN {
<!-- % dont -->
# }
# NOT RUN {
(Dls <- as.Date(.leap.seconds))
## length(<Date>) <- n now works
ls <- Dls; length(ls) <- 12
l2 <- Dls; length(l2) <- 5 + length(Dls)
stopifnot(exprs = {
## length(.) <- * is compatible to subsetting/indexing:
identical(ls, Dls[seq_along(ls)])
identical(l2, Dls[seq_along(l2)])
## has filled with NA's
is.na(l2[(length(Dls)+1):length(l2)])
})
# }
Run the code above in your browser using DataLab