George Mason University Antonin Scalia Law School

Create Course Schedule HTML Table Using R

Referenced in steps below: Course Schedule Instructions.

  1. Save a copy of the original Excel file to come back to later for the Notes sections.
  2. Open up the original Excel file, merge multiple faculty into one row, then delete all the empty rows.
  3. Make sure columns are identical to the column names in script (do not include Room Number or First Name of Instructor). Delete hidden columns (Room Number, First Name of Instructor, etc.). Make sure column names match these: CRN#, CRS#, SEC, Course Title, Instructor, Cr Hr, Days, Time, Room, Exam Date, Exam Time
  4. Make sure footnotes are standardized, e.g., (E) and not (E ) with a space (Update: script has been updated to account for this)
  5. Remove all rows that are not the table header (first row) or the courses.
  6. Save DAY and EVE sheets each as two new csvs by highlighting all cells with data and copying/pasting them into a new file/save as csv (to avoid extra blank columns that may be present by saving entire sheet). Do not open them (especially in Excel) once they are saved, because this may change how the Section numbers are interpreted and may cause 001 to be 1, and so forth.
  7. The R code below covers Steps 2 – 6 in Course Schedule Instructions to create the HTML table.
  8. In R code, update the “dayNotes” variable to match the number of Day Notes. Update the file paths/names for input files and output file.
  9. Paste output into an HTML editor. Copy and paste notes from the copy of the original Excel file to the bottom of the HTML page.
  10. Once everything looks good, paste into MODX.