File: calendar-isBizday.Rd

package info (click to toggle)
r-cran-timedate 3012.100-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 2,592 kB
  • ctags: 4
  • sloc: makefile: 13
file content (45 lines) | stat: -rw-r--r-- 1,033 bytes parent folder | download | duplicates (4)
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
\name{isBizday}

\alias{isBizday}
\alias{isHoliday}

\title{Business and Holidays}

\description{
    Tests if a date is a business day or not.
}

\usage{
isBizday(x, holidays = holidayNYSE(), wday = 1:5)
isHoliday(x, holidays = holidayNYSE(), wday = 1:5)
}

\arguments{
  \item{x}{an object of class \code{timeDate}.}
  \item{holidays}{
    holiday dates from a holiday calendar.  An object of class
    \code{timeDate}.}
  \item{wday}{
    Specify which days should be considered as weekdays. By default
    from Mondays to Fridays.
  }
}

\value{
  a logical vector of the same length as \code{x} indicating if a date
  is a business day, or a holiday, respectively.
}

\examples{## Dates in April, currentYear:
   currentYear = getRmetricsOptions("currentYear")
   tS = timeSequence(
      from = paste(currentYear, "-03-01", sep = ""),
      to = paste(currentYear, "-04-30", sep = ""))
   tS

## Subset Business Days at NYSE:
   holidayNYSE()
   isBizday(tS, holidayNYSE())
   tS[isBizday(tS, holidayNYSE())]
}
\keyword{chron}