Filter Course Schedule by Subject Code (Regex-Friendly)
Source:R/get_subject_schedule.R
get_subject_schedule.Rd
Returns a subset of the schedule where the SUBJ
(subject code) column matches a given pattern.
Matching is case-insensitive and supports regular expressions.
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.
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