-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path99_country_holidays.R
95 lines (92 loc) · 2.69 KB
/
99_country_holidays.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# 99_country_holidays.R
# Make file of country-specific holidays
# abandoned in favour of https://github.com/tinohager/Nager.Date
# June 2019
library(timeDate) # for holidays
# a) Easter and Xmas, common to all
easter1 = as.Date(holiday(year = 2012:2018, Holiday = "GoodFriday"))
easter2 = as.Date(holiday(year = 2012:2018, Holiday = "Easter"))
easter3 = as.Date(holiday(year = 2012:2018, Holiday = "EasterSunday"))
easter4 = as.Date(holiday(year = 2012:2018, Holiday = "EasterMonday"))
xmas1 = as.Date(holiday(year = 2012:2018, Holiday = "ChristmasEve"))
xmas2 = as.Date(holiday(year = 2012:2018, Holiday = "ChristmasDay"))
xmas3 = as.Date(holiday(year = 2012:2018, Holiday = "BoxingDay"))
xmas4 = as.Date(holiday(year = 2012:2019, Holiday = "NewYearsDay")) # kept to 2019 because a small number of papers drift over into 2019 by one day because of time zone difference
# b) country-specific holidays
holiday.frame = read.table(header = TRUE, sep = ',', stringsAsFactors = FALSE, text = '
country,holiday
Canada,CAVictoriaDay
Canada,CACanadaDay
Canada,CACivicProvincialHoliday
Canada,CALabourDay
Canada,CAThanksgivingDay
Canada,CaRemembranceDay.
USA,USNewYearsDay
USA,USInaugurationDay
USA,USMLKingsBirthday
USA,USLincolnsBirthday
USA,USWashingtonsBirthday
USA,USMemorialDay
USA,USIndependenceDay
USA,USLaborDay
USA,USColumbusDay
USA,USElectionDay
USA,USVeteransDay
USA,USThanksgivingDay
USA,USChristmasDay
USA,USCPulaskisBirthday
USA,USGoodFriday
UK,GBMayDay
UK,GBBankHoliday
UK,GBSummerBankHoliday
Germany,DEAscension
Germany,DECorpusChristi
Germany,DEGermanUnity
Germany,DEChristmasEve
Germany,DENewYearsEve
France,FRFetDeLaVictoire1945
France,FRAscension
France,FRBastilleDay
France,FRAssumptionVirginMary
France,FRAllSaints
France,FRArmisticeDay
Italy,ITEpiphany
Italy,ITLiberationDay
Italy,ITAssumptionOfVirginMary
Italy,ITAllSaints
Italy,ITStAmrose
Italy,ITImmaculateConception
Japan,JPNewYearsDay
Japan,JPGantan
Japan,JPBankHolidayJan2
Japan,JPBankHolidayJan3
Japan,JPComingOfAgeDay
Japan,JPSeijinNoHi
Japan,JPNatFoundationDay
Japan,JPKenkokuKinenNoHi
Japan,JPGreeneryDay
Japan,JPMidoriNoHi
Japan,JPConstitutionDay
Japan,JPKenpouKinenBi
Japan,JPNationHoliday
Japan,JPKokuminNoKyujitu
Japan,JPChildrensDay
Japan,JPKodomoNoHi
Japan,JPMarineDay
Japan,JPUmiNoHi
Japan,JPRespectForTheAgedDay
Japan,JPAutumnalEquinox
Japan,JPHealthandSportsDay
Japan,JPTaiikuNoHi
Japan,JPNationalCultureDay
Japan,JPBunkaNoHi
Japan,JPThanksgivingDay
Japan,JPEmperorsBirthday
Switzerland,CHBerchtoldsDay
Switzerland,CHSechselaeuten
Switzerland,CHAscension
Switzerland,CHConfederationDay
Switzerland,CHKnabenschiessen'
)
# save
save(holidays, file='data/holidays.RData')