File: calendar-isWeekday.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 (59 lines) | stat: -rw-r--r-- 822 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
\name{isWeekday}


\alias{isWeekday}
\alias{isWeekend}


\title{Weekdays and Weekends}


\description{

    Tests if a date is a weekday or not.

}


\usage{
isWeekday(x, wday = 1:5)
isWeekend(x, wday = 1:5)
}


\arguments{

  \item{x}{
    an object of class \code{timeDate}.
  }
  \item{wday}{
    Specify which days should be considered as weekdays. By default
    from Mondays to Fridays.
  }
}


\value{

    the functions return logical vectors indicating if a date is a
    weekday, or a weekend day.

}


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

## Subset of Weekends:
   isWeekend(tS)
   tS[isWeekend(tS)]
}


\keyword{chron}