Learn R Programming

timeDate (version 4041.110)

specialHolidayGB: Dates of special one-off holidays in the UK

Description

Gives dates of special one-off holidays in the UK.

Usage

specialHolidayGB(year = getRmetricsOptions("currentYear"),
                     value = "timeDate", named = FALSE, ...)

Value

a "timeDate" or a character vector, as requested by argument

value

Arguments

year

the year(s) for which special holidays are required, a vector containing four-digit integer number(s) of the form CCYY, e.g. 2023.

value

the class of the returned value. If "timeDate", the default, return a "timeDate" object, if "" return a character vector.

named

if TRUE, the dates are named, otherwise unnamed.

...

further arguments for as.character when value = "".

Author

Georgi N. Boshnakov

Details

specialHolidayGB gives the special Bank holidays in England for the years specified by argument year, such as the Millenium day at the end of 1999 and significant Royal events. Don't assume that there is at most one special holiday in a given year, 2022 had two.

Years that do not contain special Bank holidays are omitted. If there are no special holidays in the specified year(s) the results is a "timeDate" or "character" object of length zero.

The holidays are sorted in increasing time order.

Argument value controls the class of the result. The default is "timeDate". The result is a character vector if value = "" (the empty string). In the latter case, further arguments for the transformation to character can be passed in argument "..." (e.g., format).

If argument named is TRUE, the dates get names asssociated with them, so one can see which date represents which holiday.

See Also

GBSummerBankHoliday for functions giving specific regular Bank holidays,

holidayLONDON for all London Stock Exchange holidays (actually, England holidays) in requested years.

Examples

Run this code
## UK Millenium day
specialHolidayGB(1999)     # as a dateTime object
specialHolidayGB(1999, "") # as a character string

## 2 special holidays in UK in 2022
specialHolidayGB(2022)     # [2022-06-03] [2022-09-19]
## what are their names?
specialHolidayGB(2022, named = TRUE)

## the Spring BH is usually on last Monday of May, but not in 2022
dayOfWeek(GBSpringBankHoliday(2020:2024))

## the above formed a nice 4-day weekend in early June 2022
## (look at the Thu-Fri sequence on 2-3 June)
dayOfWeek(holidayLONDON(2022))

Run the code above in your browser using DataLab