getCalendar: Build a calendar

View source: R/getCalendar.R

getCalendarR Documentation

Build a calendar

Description

Define a calendar, with three different "seasons" (winter, summer and interseason) and two types of days (working days and weekends)

Usage

getCalendar(dates, interSeasonBegin, interSeasonEnd, dayExclude = NULL,
  holiday = c("NewYearsDay", "GoodFriday", "EasterSunday",
  "EasterMonday", "LaborDay", "FRAscension", "Pentecost",
  "PentecostMonday", "FRAssumptionVirginMary", "FRAllSaints",
  "FRArmisticeDay", "ChristmasEve", "ChristmasDay", "BoxingDay",
  "DENewYearsEve"), dayInWeekend = c(6, 7))

Arguments

dates

character or date, vector of dates YYYY-MM-DD, can be generate with getSequence

interSeasonBegin

character or date, date or vector of dates, YYYY-MM-DD, begin of interseason

interSeasonEnd

character or date, date or vector of dates, YYYY-MM-DD, end of interseason

dayExclude

character or date, date or vector of dates, YYYY-MM-DD, day(s) to exclude from the calendar

holiday

character, see holiday for holidays names, holidays will be considered as weekends. Holidays days by default are : NewYearsDay,GoodFriday,EasterSunday, EasterMonday,LaborDay,FRAscension,Pentecost,PentecostMonday, FRAssumptionVirginMary,FRAllSaints,FRArmisticeDay, ChristmasEve,ChristmasDay,BoxingDay,DENewYearsEve

dayInWeekend

numeric, indice of weekend days. By default c(6,7) for saturdays and sundays

Value

A list of vector of dates. The name of each element of the list is a so-called "class" (season x type of day, e.g. summerWd).

Examples


## Not run: 
dates <- getSequence("2017-01-01", "2017-12-31")
interSeasonBegin <- c("2017-03-01", "2017-09-01")
interSeasonEnd <- c("2017-05-01", "2017-11-01")
dayExclude <- c("2017-06-15", "2017-06-16")
getCalendar(dates, interSeasonBegin, interSeasonEnd, dayExclude = dayExclude)

## End(Not run)


rte-antares-rpackage/fbClust documentation built on July 4, 2023, 12:06 a.m.