plot_date_to_period_year: Depict the intervals created by function...

Description Usage Arguments Details Examples

View source: R/plot_date_to_period.R

Description

Create plot illustrating how function date_to_period_year works.

Usage

1
plot_date_to_period_year(date, month_start = "Jan", label_year_start = TRUE)

Arguments

date

Dates of events or measurements. A vector of class Date, or a vector than can be coerced to class Date via function as.Date.

month_start

An element of month.name, or month.abb. Each period starts on the first day of this month.

label_year_start

Whether to label a period by the calendar year at the beginning of the period or the calendar year at the end. Defaults to TRUE.

Details

plot_date_to_period_year is typically used for learning or documentation, rather than for actual data analysis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
plot_date_to_period_year(date = c("2024-03-27",
                                  "2022-11-09"))

## July to June
plot_date_to_period_year(date = c("2024-03-27",
                                  "2022-11-09"),
                         month_start = "Jul")

## July to June, using the calendar year at
## the end for the label
plot_date_to_period_year(date = c("2024-03-27",
                                  "2022-11-09"),
                         month_start = "Jul",
                         label_year_start = FALSE)

johnrbryant/demprep documentation built on Dec. 31, 2021, 11:58 a.m.