Learn R Programming

qlcal (version 0.1.0)

isWeekend: Test for weekends

Description

Test a vector of dates for weekends

Usage

isWeekend(dates = NULL, xp = NULL)

Value

A logical vector indicating which dates are weekends

Arguments

dates

An optional Date vector with dates to be examined, if missing the current day is used

xp

An optional calendar object, if missing the default instance is used

Details

This function takes a vector of dates and returns a logical vector of the same length indicating at each position whether the corresponding date is a weekend in the currently active (global) calendar.

Examples

Run this code
isWeekend(Sys.Date()+0:6)

Run the code above in your browser using DataLab