| Title: | Compensation Analysis Tool for Instructor Overload Pay |
|---|---|
| Description: | Calculates equitable overload compensation for college instructors based on institutional policies, enrollment thresholds, and regular teaching load limits. Compensation is awarded only for credit hours that exceed the regular load and meet minimum enrollment criteria. When enrollment is below a specified threshold, pay is prorated accordingly. The package prioritizes compensation from high-enrollment courses, or optionally from low-enrollment courses for fairness, depending on user-defined strategy. Includes tools for flexible policy settings, instructor filtering, and produces clean, audit-ready summary tables suitable for payroll and administrative reporting. |
| Authors: | Dawit Aberra [aut, cre] |
| Maintainer: | Dawit Aberra <[email protected]> |
| License: | AGPL-3 |
| Version: | 1.0.1 |
| Built: | 2026-06-04 09:47:51 UTC |
| Source: | https://github.com/dawit3000/catool |
Applies one or more filters to a course schedule using pattern matching on instructor, subject, college, department, and program. All matching is case-insensitive and based on partial string matching.
filter_schedule( schedule, subject_pattern = NULL, instructor_pattern = NULL, college_pattern = NULL, department_pattern = NULL, program_pattern = NULL )filter_schedule( schedule, subject_pattern = NULL, instructor_pattern = NULL, college_pattern = NULL, department_pattern = NULL, program_pattern = NULL )
schedule |
A data frame containing the course schedule with required columns: |
subject_pattern |
Optional regex pattern to match subject codes (e.g., "CSCI", "^MATH"). |
instructor_pattern |
Optional regex pattern to match instructor names (e.g., "Smith", "^Jones"). |
college_pattern |
Optional regex pattern to match college names (e.g., "Science", "Engineering"). |
department_pattern |
Optional regex pattern to match department names (e.g., "Math", "Biology"). |
program_pattern |
Optional regex pattern to match program names (e.g., "Undergraduate", "MBA"). |
A filtered data frame of matching courses.
schedule <- data.frame( INSTRUCTOR = c("Lee", "Smith", "Jones", "Dawson", "Garcia"), SUBJ = c("MATH", "NURS", "CSCI", "ENGL", "COMM"), COLLEGE = c("Science", "Nursing", "Science", "Arts and Sciences", "Arts and Communication"), DEPARTMENT = c("Math", "Nursing", "CS", "English", "Comm Studies"), PROGRAM = c("BS", "BSN", "BS", "BA", "BA"), stringsAsFactors = FALSE ) filter_schedule(schedule, subject_pattern = "^MATH|^STAT") filter_schedule(schedule, instructor_pattern = "smith") filter_schedule(schedule, college_pattern = "Science") filter_schedule(schedule, department_pattern = "Comm") filter_schedule(schedule, program_pattern = "^BA$")schedule <- data.frame( INSTRUCTOR = c("Lee", "Smith", "Jones", "Dawson", "Garcia"), SUBJ = c("MATH", "NURS", "CSCI", "ENGL", "COMM"), COLLEGE = c("Science", "Nursing", "Science", "Arts and Sciences", "Arts and Communication"), DEPARTMENT = c("Math", "Nursing", "CS", "English", "Comm Studies"), PROGRAM = c("BS", "BSN", "BS", "BA", "BA"), stringsAsFactors = FALSE ) filter_schedule(schedule, subject_pattern = "^MATH|^STAT") filter_schedule(schedule, instructor_pattern = "smith") filter_schedule(schedule, college_pattern = "Science") filter_schedule(schedule, department_pattern = "Comm") filter_schedule(schedule, program_pattern = "^BA$")
Returns a subset of the course schedule containing courses taught by the specified instructor. Matching is case-insensitive and supports regular expressions, allowing flexible partial or pattern-based matching. If no match is found, a warning is issued and an empty data frame is returned.
get_instructor_schedule(instructor_name, schedule_df = schedule)get_instructor_schedule(instructor_name, schedule_df = schedule)
instructor_name |
A character string (or regular expression) used to match against values in the |
schedule_df |
A data frame containing course schedule data with an |
A data frame of courses assigned to instructors matching the given pattern, sorted by descending enrollment.
get_instructor_schedule("smith", schedule_df = schedule) # partial match get_instructor_schedule("^Smith,", schedule_df = schedule) # regex: starts with Smith get_instructor_schedule("Robinson|Smith", schedule_df = schedule) # regex: matches eitherget_instructor_schedule("smith", schedule_df = schedule) # partial match get_instructor_schedule("^Smith,", schedule_df = schedule) # regex: starts with Smith get_instructor_schedule("Robinson|Smith", schedule_df = schedule) # regex: matches either
Returns a subset of the schedule where the SUBJ (subject code) column matches a given pattern.
Matching is case-insensitive and supports regular expressions.
get_subject_schedule(subject_pattern, schedule)get_subject_schedule(subject_pattern, schedule)
subject_pattern |
A character string or regular expression to match subject codes. |
schedule |
A data frame containing course schedule data with a |
A filtered data frame containing only matching subject codes.
schedule <- data.frame(SUBJ = c("CSCI", "MATH", "STAT")) get_subject_schedule("CSCI", schedule) get_subject_schedule("^MATH|^STAT", schedule)schedule <- data.frame(SUBJ = c("CSCI", "MATH", "STAT")) get_subject_schedule("CSCI", schedule) get_subject_schedule("^MATH|^STAT", schedule)
Extracts a sorted vector of unique, non-empty instructor names from a schedule data frame.
get_unique_instructors(schedule_df)get_unique_instructors(schedule_df)
schedule_df |
A data frame containing an |
A character vector of instructor names, sorted alphabetically.
get_unique_instructors(schedule)get_unique_instructors(schedule)
Computes prorated overload pay and qualified credit hours for a single instructor based on course credit hours, enrollment, and institutional overload rules.
ol_comp( instructor_schedule, L = 4, U = 9, rate_per_cr = 2500/3, reg_load = 12, favor_institution = TRUE )ol_comp( instructor_schedule, L = 4, U = 9, rate_per_cr = 2500/3, reg_load = 12, favor_institution = TRUE )
instructor_schedule |
A data frame of the instructor's courses, with columns |
L |
Lower enrollment threshold for overload pay qualification (default = 4). |
U |
Upper limit of proration; courses with ENRLD > U get full-rate pay (default = 9). |
rate_per_cr |
Base overload pay per credit hour (default = 2500/3). |
reg_load |
Regular teaching load in credit hours (default = 12). |
favor_institution |
Logical: if TRUE (default), prioritizes high-enrollment courses for regular load. |
If favor_institution = TRUE (default), the function assigns high-enrollment
qualified courses to the regular load first, resulting in lower compensation
because only low-enrollment courses are left for overload pay — this favors the institution.
If favor_institution = FALSE, the function assigns low-enrollment qualified
courses to the regular load first, preserving high-enrollment courses for compensation —
this favors the instructor.
Note: This function assumes that instructor_schedule is already filtered for one instructor.
Use get_instructor_schedule() to extract an instructor’s schedule using
flexible, case-insensitive pattern matching (regex supported, e.g., "smith|jones").
A tibble with course-level compensation and a human-readable summary block.
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 )ol_comp_byindex( i, schedule_df, L = 4, U = 9, rate_per_cr = 2500/3, reg_load = 12, favor_institution = TRUE )
i |
Integer index of the instructor (as returned by |
schedule_df |
A data frame of the full course schedule containing an |
L |
Lower enrollment threshold for overload pay eligibility (inclusive). Default is 4. |
U |
Upper enrollment limit for proration (inclusive). Default is 9. |
rate_per_cr |
Overload pay rate per qualified credit hour. Default is 2500/3. |
reg_load |
Regular teaching load in credit hours. Default is 12. |
favor_institution |
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").
Invisibly returns a tibble with the instructor’s course-level overload compensation summary.
# Example usage with a schedule dataframe: # ol_comp_byindex(1, schedule_df = schedule)# Example usage with a schedule dataframe: # ol_comp_byindex(1, schedule_df = schedule)
Calculates overload compensation for each instructor based on institutional policy. The output includes course-level payments, qualified credit hours, and a readable instructor-level summary block that follows each instructor's courses.
ol_comp_summary( schedule_df, instructor = NULL, L = 4, U = 9, rate_per_cr = 2500/3, reg_load = 12, favor_institution = TRUE )ol_comp_summary( schedule_df, instructor = NULL, L = 4, U = 9, rate_per_cr = 2500/3, reg_load = 12, favor_institution = TRUE )
schedule_df |
A data frame containing course schedule information. Must include
columns such as |
instructor |
Optional string. If provided, limits the summary to a single instructor. Default is NULL (includes all instructors). |
L |
Minimum enrollment required for overload pay eligibility. Default is 4. |
U |
Upper threshold for proration. Courses with ENRLD > U receive full-rate pay. Default is 9. |
rate_per_cr |
Overload pay rate per credit hour. Default is 2500/3. |
reg_load |
Regular teaching load in credit hours. Default is 12. |
favor_institution |
Logical: if TRUE (default), prioritizes high-enrollment courses for regular load. |
If the instructor argument is specified, the function limits the summary to that instructor.
Matching is exact and case-sensitive unless pre-filtered using get_instructor_schedule(),
which supports regex-based, case-insensitive pattern matching (e.g., "smith|jones").
A tibble combining course-level compensation and a summary section for each instructor.
This dataset represents a sample class schedule used by several institutions, with slight variations in variable names.
Users must ensure that the key variables—HRS, ENRLD, and INSTRUCTOR—are properly named and formatted for the functions in this package to work correctly.
scheduleschedule
An object of class data.frame with 665 rows and 15 columns.
A dataset containing instructor schedules for overload analysis.
The dataset has 665 rows and 15 columns, including:
Credit hours of the course.
Number of students enrolled in the course.
Name of the instructor teaching the course (anonymized).
Included in the package under data/schedule.rda