Hello,

I'm using the Rbbg package (please suggest an alternative that is faster if
you know of one). I'd like to get my data into a flat matrix where row
names are found like this for quarterly data:

get_dates <- function(Start, End,end_of,every)
{
  Vec <- as.Date(levels(cut(seq.Date(Start, End, by = end_of),breaks =
every)))
  Vec[-1] - 1
}
qtrs = get_dates(from_date, to_date,end_of= "month",every = "quarter")
qtrs = qtrs[length(qtrs):1]
> qtrs
[1] "2012-03-31" "2011-12-31" "2011-09-30" "2011-06-30" "2011-03-31"
"2010-12-31" "2010-09-30" "2010-06-30" "2010-03-31" "2009-12-31"
[11] "2009-09-30" "2009-06-30" "2009-03-31" "2008-12-31" "2008-09-30"
"2008-06-30" "2008-03-31" "2007-12-31" "2007-09-30" "2007-06-30"

...and all companies that report after the quarter end date (above) and
before the next one are moved back one. For example, if a company reporting
period ended in Jan. 2012, those values would be on the 2011-12-31 row.
(These are then adjusted for look-ahead using the actual report date.)

Is there a function that will do this in zoo or another package?

Thanks!

Ben

	[[alternative HTML version deleted]]

