Displaying 1 result from an estimated 1 matches for "curryear".
2006 Feb 17
3
(Newbie) Functions on vectors
...ion more efficient, by vectorizing it:
getCriterionDecisionDate <- function (quarter , year)
{
if (length(quarter) != length(year)) stop ("Quarter and year vectors
of unequal length!");
ret <- character(0);
for (i in 1:length(quarter)) {
currQuarter <- quarter[i];
currYear <- year[i];
if ((currQuarter < 1) | (currQuarter > 4)) stop ("Invalid quarter!");
if ((currYear < 1986) | (currYear > 2004)) stop ("Invalid year!");
# If the criterion date is 1Q2004, then the reports were for periods
# ending in Feb, March and A...