date_to_sy: Convert a date value into its school year.
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
date_to_sy(date_var, last_day_of_sy = NULL)
Value
Returns a character vector in the format of "2013 - 2014"
A character vector the same length as date_var
Arguments
date_var
the date to convert. Can be a Date object or a string in the form 'YYYY-MM-DD' or 'MM/DD/YYYY'
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. Defaults (noisily) to July 1st.