qtr | R Documentation |
The qtr functions take a date input and calculate the relevant quarter-related value from it. They all return the year as part of this value.
qtr
returns the current quarter
qtr_end
returns the last month in the quarter
qtr_next
returns the next quarter
qtr_prev
returns the previous quarter
qtr(date, format = c("long", "short"))
qtr_end(date, format = c("long", "short"))
qtr_next(date, format = c("long", "short"))
qtr_prev(date, format = c("long", "short"))
date |
A date which must be supplied with |
format |
A |
Quarters are defined as:
January to March (Jan-Mar)
April to June (Apr-Jun)
July to September (Jul-Sep)
October to December (Oct-Dec)
A character vector of financial quarters in the specified format.
x <- lubridate::dmy(c(26032012, 04052012, 23092012))
qtr(x)
qtr_end(x, format = "short")
qtr_next(x)
qtr_prev(x, format = "short")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.