calendar-isWeekday: Weekdays and Weekends

Description Usage Arguments Value Examples

Description

Tests if a date is a weekday or not.

Usage

1
2
isWeekday(x, wday = 1:5)
isWeekend(x, wday = 1:5)

Arguments

x

an object of class timeDate.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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)]


Search within the timeDate package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.