Create a sequence of useful days in R

0

I have a data frame the following columns:

Date (Days of the week only, no holidays, over several years) Month Year ... I want to create a workday sequence. So I wanted a function that read the smallest day of the first month and the largest day of the first month and put a sequence from 1 to the end. And repeat this for every month of my database.

Any ideas ??

    
asked by anonymous 09.05.2017 / 00:20

1 answer

3

Use the Wilson Freitas package bizdays

# install.packages('bizdays')
bizdays::bizseq('2017-01-01', '2017-01-31', cal = "Brazil/ANBIMA")

#> [1] "2017-01-02" "2017-01-03" "2017-01-04" "2017-01-05" "2017-01-06"
#> [6] "2017-01-09" "2017-01-10" "2017-01-11" "2017-01-12" "2017-01-13"
#>[11] "2017-01-16" "2017-01-17" "2017-01-18" "2017-01-19" "2017-01-20"
#>[16] "2017-01-23" "2017-01-24" "2017-01-25" "2017-01-26" "2017-01-27"
#>[21] "2017-01-30" "2017-01-31"

You can adjust calendar options by first looking at the help of this function.

    
09.05.2017 / 17:36