date_to_sy: Convert a date value into its school year.

Description Usage Arguments Value Examples

View source: R/date_to_sy.R

Description

Checks to see if a date is past the user-specified cutoff point for delineating school years, then maps to the appropriate year.

Usage

1
date_to_sy(date_var, last_day_of_sy)

Arguments

date_var

the date to convert.

last_day_of_sy

the cutoff date, after which a date is considered part of the following school year. The year of this argument does not matter.

Value

Returns a character vector in the format of "2013 - 2014"

Examples

1
2
date_to_sy(as.Date("2014-05-05"), as.Date("2000-07-01"))
date_to_sy(as.Date("2014-07-05"), as.Date("2000-07-01"))

tntp/tntpr documentation built on Aug. 11, 2019, 4:52 a.m.