knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  warning = FALSE,
  message = FALSE
)
options(tibble.print_min = 5, tibble.print_max = 5)

liburrr: Indonesia holiday R package

Libur telah tiba, libur telah tiba :musical_note::musical_note::musical_note:

liburrr is an R package which contains functionality related to holiday date in Indonesia. The name of liburrr with three 'r' is inspired with R package purrr.

Installation

# install.packages("devtools")
devtools::install_github("rasyidstat/liburrr")

Example

library(liburrr)
library(dplyr)
df <- data.frame(dt = seq.Date(as.Date("2020-01-01"), as.Date("2020-01-07"), "day") )
df <- df %>%
  mutate(weekend_flag = is_weekend(dt),
         holiday_flag = is_libur(dt),
         holiday_flag_all = ifelse(weekend_flag == FALSE, holiday_flag, weekend_flag),
         holiday_desc = is_libur(dt, label = TRUE))
df


rasyidstat/liburrr documentation built on Jan. 28, 2020, 9:29 p.m.