Utilities for working with academic years
academic_year.Rd
Utilities for working with academic years
Arguments
- x
For
academic_year()
: A numeric vectorFor
as_academic_year()
: An object to coerceFor
is_academic_year()
: An object to test
- boundary
A boundary date where the new academic year should begin. Note that only the month/day of this date is used. This can be set using the global option
acadyr.academic_year_boundary
. E.g. to use academic years starting on August 1, use the following:- ...
Passed on to methods
For
academic_year()
: A<financial_year>
vectorFor
as_academic_year()
: A<financial_year>
vectorFor
is_academic_year()
: A<logical>
vector
Details
Note that many countries use a slightly different academic year start date each year, meaning that most use-cases for these utilities will necessitate some approximation.
Examples
# Numbers are treated as if they represent years
academic_year(2005:2015)
#> <academic_year[11]>
#> [1] 2005/06 2006/07 2007/08 2008/09 2009/10 2010/11 2011/12 2012/13 2013/14
#> [10] 2014/15 2015/16
# Dates are mapped to the year they fall within
dates <- as.Date(c("2020-08-01", "2020-09-01"))
academic_year(dates)
#> <academic_year[2]>
#> [1] 2019/20 2020/21
# The year they fall within depends on the year boundary, which
# defaults to September 01
academic_year(dates, boundary = as.Date("2020-08-01"))
#> <academic_year[2]>
#> [1] 2020/21 2020/21
# as_academic_year() also understands character vectors:
as_academic_year(c("2020/21", "2021/22"))
#> <academic_year[2]>
#> [1] 2020/21 2021/22