Skip to contents

Trimesters divide the year into thirds. This is largely based on lubridate::quarter.

Usage

trimester(x, type = "ay_year trimester", academic_start = 1)

Arguments

x

A date-time object.

type

The format to be returned for the trimester. See details. They are similar to the options for lubridate::quarter.

academic_start

A integer from 1 to 12 indicating the month for the start of the academic year.

Value

A numeric, character, or factor depending on type.

Details

The type argument has a number of possibilities.

  • ay_year trimester: The default. Academic year followed by a "T" and the trimester number.

  • trimester: A numeric value of the trimester.

  • ay_year.trimester: Academic year with trimester in numeric form.

  • year_start/end: The calendar years which the academic year spans.

  • date_last: Date on which the term ends, rounded down to the month.

  • date_first: Date on which the term begins, rounded down to the month.

  • season: The season of the term. This is a factor.

  • season cal_year: The season with the calendar year.

Examples

trimester(lubridate::as_date("2024-08-24"), academic_start = 5)
#> [1] "2025 T1"

trimester(lubridate::today(), academic_start = 5)
#> [1] "2026 T1"

trimester(lubridate::today(), type = "trimester", academic_start = 5)
#> [1] 1