Retrieves an instructor's name by index from the schedule and calculates their overload compensation
using ol_comp(). Returns a clean, readable course-level compensation summary.
ol_comp_byindex(
i,
schedule_df,
L = 4,
U = 9,
rate_per_cr = 2500/3,
reg_load = 12,
favor_institution = TRUE
)Invisibly returns a tibble with the instructor’s course-level overload compensation summary.
Integer index of the instructor (as returned by get_unique_instructors()).
A data frame of the full course schedule containing an INSTRUCTOR column.
Lower enrollment threshold for overload pay eligibility (inclusive). Default is 4.
Upper enrollment limit for proration (inclusive). Default is 9.
Overload pay rate per qualified credit hour. Default is 2500/3.
Regular teaching load in credit hours. Default is 12.
Logical: if TRUE (default), favors the institution by prioritizing high-enrollment courses for regular load.
If favor_institution = TRUE (default), the function assigns high-enrollment
courses to the regular load first, minimizing compensation.
If favor_institution = FALSE, low-enrollment courses are used toward the regular load first,
preserving high-enrollment courses for overload pay.
This function internally uses get_instructor_schedule(), which supports flexible,
case-insensitive regex matching for instructor names (e.g., "^smith$" or "johnson|williams").
# Example usage with a schedule dataframe:
# ol_comp_byindex(1, schedule_df = schedule)
Run the code above in your browser using DataLab