Consider using string distance measures to join the messy data with a predefined list of standard course names, you can use the fuzzyjoin
package to help you with that.
If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.