Indonesia holiday R package
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R fix holiday function May 12, 2018
data fix holiday list Jun 12, 2018
man add holiday function Apr 26, 2018
.Rbuildignore first commit Feb 10, 2018
.gitignore first commit Feb 10, 2018
DESCRIPTION first function Feb 10, 2018
NAMESPACE
README.Rmd
README.md add holiday function Apr 26, 2018
liburrr.Rproj

README.md

liburrr: Indonesia holiday R package

Libur telah tiba, libur telah tiba 🎵🎵🎵

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)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
df <- data.frame(dt = as.Date(c("2016-01-01","2016-01-02","2016-01-03")))
df <- df %>%
  mutate(weekend_flag = is_weekend(dt),
         holiday_flag = is_holiday(dt),
         holiday_flag_all = ifelse(weekend_flag == FALSE, holiday_flag, weekend_flag))
df
#>           dt weekend_flag holiday_flag holiday_flag_all
#> 1 2016-01-01        FALSE         TRUE             TRUE
#> 2 2016-01-02         TRUE        FALSE             TRUE
#> 3 2016-01-03         TRUE        FALSE             TRUE