The goal of ProfRate
is to retrieve and visualize the data on Rate My Professor. For details, please see the website for ProfRate and the Shiny app. The set of slides for this project can be found at this link.
You can install the development version of ProfRate
with:
### install.packages("devtools")
devtools::install_github("m-fili/ProfRate")
ProfRate
files and use
install.packages("file_path_to_target_package/ProfRate", repos=NULL, type="source")
Note that file_path_to_target_package
is the placeholder and needs to be replace by the correct relative path on your machine.
This basic example shows you how to retrieve and visualize the data using ProfRate
.
The function get_tid
gets teacher IDs and general information by name, department, and university. The name must be as accurate as possible to filter the results and speed up. All inputs are case insensitive and support partial input.
name <- "Brakor"
department <- "Biology"
university <- "California Berkeley"
get_tid(name = name, university = university)
get_tid(name = name, department = department, university = university)
The function get_url
gets URLs by name, department and university. It use get_tid
inside, so it follows the same requirements as get_tid
for inputs.
get_url(name = name, university = university)
get_url(name = name, department = department, university = university)
After getting the URL for a professor by name, department, and university, we can use the URL as input for other functions, which avoids scrapping the website multiple times.
The function general_info
extracts general information for an instructor. It is used in get_tid
to generate the output tibble.
url <- "https://www.ratemyprofessors.com/ShowRatings.jsp?tid=2036448"
general_info(url)
The function get_all_schools
find the university URL using its name. It is used in get_tid
to filter the search result. Although further analysis of a specific university is possible, it is not our main interest for ProfRate
.
get_all_schools("Iowa State University")
The function comment_info
extracts information on comments, including course, year, comments, number of thumbs-ups, and number of thumbs-downs.
comment_info(url = url, y = 2018)
The function sentiment_info
uses comment_info
to provide positive and negative words extracted from comments and tags from the website.
sentiment_info(url = url, y = 2018, word = "Negative")
The function sentiment_plot
uses sentiment_info
to generate a wordcloud.
sentiment_plot(url = url, y = 2018, word = "Positive")
The function ratings_info
shows and summarizes all rating information for an instructor.
ratings_info(url = url, y = 2018)
The function ratings_plot
uses ratings_info
to create a box plot of all ratings and 3 bar plots of average ratings by course, grade, and year for an instructor.
ratings_plot(url = url, y = 2018)
The function runExample
runs the Shiny app.