Skip to content
Prev 2207 / 15274 Next

functions for quarterly settlement dates

On Sat, Feb 23, 2008 at 10:24 AM, tom soyer <tom.soyer at gmail.com> wrote:
You can do it yourself using some functions in fCalendar
(see ?timeSpecialDate).

Another possibility is using as.yearqtr, as.yearmon
in zoo together with the nextfri() function defined in
vignette("zoo-quickref").  If d is a Date then
d1 <- as.Date(as.yearmon(as.yearqtr(d)) + 2/12)
would be the first day in the last month of the quarter and
nextfri(d1)+14
would be 3rd Fri that month.

This requires the zoo package for as.yearmon and as.yearqtr
but does not require a zoo object and d can be a vector of dates.