Examples for 'lubridate::quarter'


Get the fiscal quarter and semester of a date-time

Aliases: quarter semester

Keywords:

### ** Examples

x <- ymd(c("2012-03-26", "2012-05-04", "2012-09-23", "2012-12-31"))
quarter(x)
[1] 1 2 3 4
quarter(x, type = "year.quarter")
[1] 2012.1 2012.2 2012.3 2012.4
quarter(x, type = "year.quarter", fiscal_start = 11)
[1] 2012.2 2012.3 2012.4 2013.1
quarter(x, type = "date_first", fiscal_start = 11)
[1] "2012-02-01" "2012-05-01" "2012-08-01" "2012-11-01"
quarter(x, type = "date_last", fiscal_start = 11)
[1] "2012-04-30" "2012-07-31" "2012-10-31" "2013-01-31"
semester(x)
[1] 1 1 2 2
semester(x, with_year = TRUE)
[1] 2012.1 2012.1 2012.2 2012.2

[Package lubridate version 1.8.0 Index]