Quarters divide the year into fourths. Semesters divide the year into halfs.
quarter(x, with_year = FALSE, fiscal_start = 1) semester(x, with_year = FALSE)
| x | a date-time object of class POSIXct, POSIXlt, Date, chron, yearmon, yearqtr, zoo, zooreg, timeDate, xts, its, ti, jul, timeSeries, fts or anything else that can be converted with as.POSIXlt |
|---|---|
| with_year | logical indicating whether or not to include the quarter's year. |
| fiscal_start | numeric indicating the starting month of a fiscal year |
numeric
#> [1] 1 2 3 4quarter(x, with_year = TRUE)#> [1] 2012.1 2012.2 2012.3 2012.4quarter(x, with_year = TRUE, fiscal_start = 11)#> [1] 2012.2 2012.3 2012.4 2013.1semester(x)#> [1] 1 1 2 2semester(x, with_year = TRUE)#> [1] 2012.1 2012.1 2012.2 2012.2