|
1 | | -# explore-courses |
2 | | -Download, Extract, and Transform Course Data from Stanford University's ExploreCourses in R |
| 1 | + |
| 2 | +<!-- README.md is generated from README.Rmd. Please edit that file --> |
| 3 | + |
| 4 | +# explorecourses |
| 5 | + |
| 6 | +<!-- badges: start --> |
| 7 | + |
| 8 | +[](https://github.com/coatless-rpkg/explorecourses/actions/workflows/R-CMD-check.yaml) |
| 9 | +<!-- badges: end --> |
| 10 | + |
| 11 | +> \[!IMPORTANT\] |
| 12 | +> |
| 13 | +> This package is part of a homework exercise for STATS 290 regarding |
| 14 | +> data mining and web APIs. |
| 15 | +
|
| 16 | +The goal of explorecourses is to automatically retrieve course |
| 17 | +information from Stanford University’s ExploreCourses API. |
| 18 | + |
| 19 | +## Installation |
| 20 | + |
| 21 | +You can install the development version of explorecourses from |
| 22 | +[GitHub](https://github.com/) with: |
| 23 | + |
| 24 | +``` r |
| 25 | +# install.packages("remotes") |
| 26 | +remotes::remotes("coatless-rpkg/explorecourses") |
| 27 | +``` |
| 28 | + |
| 29 | +## Usage |
| 30 | + |
| 31 | +First, load the package: |
| 32 | + |
| 33 | +``` r |
| 34 | +library(explorecourses) |
| 35 | +``` |
| 36 | + |
| 37 | +The package contains three main functions: |
| 38 | + |
| 39 | +1. `fetch_all_courses()`: Fetches all courses from the ExploreCourses |
| 40 | + API. |
| 41 | +2. `fetch_departments()`: Fetches the list of departments from the |
| 42 | + ExploreCourses API. |
| 43 | +3. `fetch_department_courses()`: Fetches the courses for a specific |
| 44 | + department. |
| 45 | + |
| 46 | +By default, we’ll retrieve all courses across all departments for the |
| 47 | +current academic year using: |
| 48 | + |
| 49 | +``` r |
| 50 | +all_courses <- fetch_all_courses() |
| 51 | +``` |
| 52 | + |
| 53 | +This information is stored in the `schedule_ay24_25` data frame. |
| 54 | + |
| 55 | +For just a single department, we can use it’s code to retrieve a list of |
| 56 | +all classes: |
| 57 | + |
| 58 | +``` r |
| 59 | +department_courses <- fetch_department_courses("STATS") |
| 60 | +``` |
| 61 | + |
| 62 | +To determine possible department shortcodes, we can use: |
| 63 | + |
| 64 | +``` r |
| 65 | +departments <- fetch_departments() |
| 66 | +``` |
0 commit comments