dates <- do.call("c", lapply(2015:2016, function(i) {
start <- as.Date(paste0(i, "-01-01"))
end <- as.Date(paste0(i, "-12-31"))
seq(start, end, 16)
}))
intervals <- c("month", "year", "fortnight")
lst <- lapply(intervals, function(i) {
aggInterval(dates, interval = i)
}); names(lst) <- intervals
print(lst)
Run the code above in your browser using DataLab