Skip to contents

Returns a subset of the schedule where the SUBJ (subject code) column matches a given pattern. Matching is case-insensitive and supports regular expressions.

Usage

get_subject_schedule(subject_pattern, schedule)

Arguments

subject_pattern

A character string or regular expression to match subject codes.

schedule

A data frame containing course schedule data with a SUBJ column.

Value

A filtered data frame containing only matching subject codes.

Examples

schedule <- data.frame(SUBJ = c("CSCI", "MATH", "STAT"))
get_subject_schedule("CSCI", schedule)
#>   SUBJ
#> 1 CSCI
get_subject_schedule("^MATH|^STAT", schedule)
#>   SUBJ
#> 1 MATH
#> 2 STAT