-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
92 lines (61 loc) · 2.09 KB
/
README.Rmd
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
---
output:
github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(vacancesscolr)
```
# vacancesscolr
[![Travis build status](https://travis-ci.org/Tutuchan/vacancesscolr.svg?branch=master)](https://travis-ci.org/Tutuchan/vacancesscolr)
The goal of `vacancesscolr` is to be able to quickly retrieve school holidays in France for the 2008-2018 period and bank holidays for any given year.
The data used in this package has been obtained from [Antoine Augusti's vacances-scolaires dataset](https://github.com/AntoineAugusti/vacances-scolaires), under the Etalab license (open license).
The functionalities are direct ports from his [vacances-scolaires-france](https://github.com/AntoineAugusti/vacances-scolaires-france) and [jours-feries-france](https://github.com/AntoineAugusti/jours-feries-france) Python packages, under MIT license.
## Installation
`vacancesscolr` lives only on Github for now. Please use `devtools` or `remotes` to install it.
``` r
devtools::install_github("tutuchan/vacancesscolr")
# OR
remotes::install_github("tutuchan/vacancesscolr")
```
## Examples
### Holidays
Check if a date is a holiday:
```{r check}
is_holiday("2018-03-05")
is_holiday("2018-03-05", zone = "A")
is_holiday("2018-03-05", zone = "B")
```
Retrieve all holidays for a year, optional zone and optional type of holiday:
```{r year}
get_holidays(2018, name = "Vacances d'hiver")
```
You can use shortened names for the holidays names:
```{r names}
holidays_names_full()
holidays_names_short()
```
### Bank holidays
Get all bank holidays for a year:
```{r bank holidays}
get_bank_holidays(2018)
```
Get a specific bank holiday:
```{r specific bank holiday}
bh_lundi_paques(2018)
```
Get the names of bank holidays (some have multiple ways to call them):
```{r bank holidays names}
bank_holidays_names()
bank_holidays_names_unique()
```
Get a bank holiday knowing its name:
```{r bank holiday}
bank_holiday("1 mai")(2018)
```