Holiday Generating Function

DESCRIPTION:

Generate a collection of holidays.

USAGE:

holidays(years, type="USFederal", move=F) 

REQUIRED ARGUMENTS:

years
years to generate holidays for.

OPTIONAL ARGUMENTS:

type
names of holidays to generate.
move
move holidays to nearest weekday if T.

VALUE:

an S time/date object containing the specified holidays, in chronological order. The time of day in the returned value is midnight in the time zone given by options("time.zone").

DETAILS:

This function calls the holiday.xxx functions, where xxx takes on the value of each of the strings in the type argument. If these functions do not exist, an error will occur. After calling the holiday.xxx functions, holidays will call holiday.nearest.weekday if move is T; this will move the holidays so they lie on weekdays. move can also be given as a logical vector, in which case each element applies to the corresponding element of type.

SEE ALSO:

, , .

EXAMPLES:

# Generate Christmas, New Years, and Veterans day, moving Christmas 
# and New Years to the nearest weekday 
holidays(1994:2005, c("Christmas", "NewYears", "Veterans"),  
         c(T, T, F))