xlWC: Week commencing date

Description Usage Arguments

View source: R/xlWC.R

Description

Find the week commencing of a date, given a specific day as the start of week.

Usage

1
xlWC(date = Sys.Date(), pre_wk = 0, wk_start = 1, format = NULL)

Arguments

date

Date value for which the week start date can be found. Default is Sys.Date

pre_wk

Integer for the number of weeks prior to the lookup date. Default is 0, no shifting of the week.

wk_start

Integer, possible values are 1 - 7, correspnoding to Monday to Sunday as the start of the week. Default is 1 for Monday.

format

A string for date output format, could be e.g. '%Y%m%d'. If left NULL then the output is of Date class. # Get the Sunday before 2 weeks prior to 1st Jan 2017 xlWC(as.Date('2017-01-01'), pre_wk = 2, wk_start = 7)


xinye1/xltools documentation built on Dec. 2, 2020, 7:23 p.m.