wom: Generate Week of the Month from a Date

View source: R/wom.R

womR Documentation

Generate Week of the Month from a Date

Description

wom() is a convenience function I use for constructing calendars in ggplot2. It takes a date and returns, as a numeric vector, the week of the month for the date given to it.

Usage

wom(x)

Arguments

x

a date

Details

wom() assumes Sunday is the start of the week. This can assuredly be customized later in this function, but right now the assumption is Sunday is the start of the week (and not Monday, as it might be in other contexts).

Value

wom() is a convenience function I use for constructing calendars in ggplot2. It takes a date and returns, as a numeric vector, the week of the month for the date given to it.

Examples


wom(as.Date("2022-01-01"))

wom(Sys.Date())

stevemisc documentation built on April 12, 2022, 5:06 p.m.