knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
The homepage introduces the functionality of the ProfRate
package.
Here, we will get into more details and its applications for those who are interested.
As a student, you might be interested to know more about a certain professor before registering for a course,
for example, an overall course quality, the difficulty level, and comments from previous students.
Luckily, the website Rate My Professor gathers various information on professors, and our ProfRate
package will utilize them and assist the users to know their professors better at a glance.
This package mainly offers a user-friendly Shiny dashboard to visualize students' feedback on a specific professor of interest. Users can also follow the examples and apply these powerful functions as helpers for other purposes.
This package provides information and visualization on the following questions:
First, we have the following flowchart summarizing the relationship and dependence among all functions in this package:
knitr::include_graphics('Functions.jpg')
There are ten functions in total. The first three functions in the green box generate the URL for the scraping procedure used in other functions. The next seven functions in the blue box are the body of the package responsible for summarization and visualization. The last one in the yellow box is used to launch the Shiny dashboard.
In short, firstly, a URL is generated using the professor's name, department, and university name. Then the comments and ratings are scraped, summarized, and plotted. All the outputs are then visualized in the Shiny dashboard.
All functions that drive webscrapping use the polite
package, and we do try our very best to be ethical scrapers.
Let us know if there are any issues with using the website data, and we will modify it accordingly.
get_all_schools
get_tid
function.Examples:
library(ProfRate)
get_all_schools('Iowa State University') get_all_schools('MIT')
general_info
get_tid
function.Examples:
general_info("https://www.ratemyprofessors.com/ShowRatings.jsp?tid=342455") general_info("https://www.ratemyprofessors.com/ShowRatings.jsp?tid=744853")
get_tid
rvest::html_text
to check nodes and regular expression to extract ids.get_tid(name = 'Brakor', university = 'California Berkeley') get_tid(name = 'Brakor', department = 'Biology', university = 'Berkeley')
get_url
get_tid
.
It assesses the tid(s) first and then generate the corresponding URL(s).Examples:
get_url(name = 'Brakor', department = 'Biology', university = 'Berkeley')
comment_info
comment_info(url = "https://www.ratemyprofessors.com/ShowRatings.jsp?tid=1031282", y = 2000) comment_info(url = "https://www.ratemyprofessors.com/ShowRatings.jsp?tid=1129448", y = 2000)
sentiment_info
Example:
sentiment_info(url = "https://www.ratemyprofessors.com/ShowRatings.jsp?tid=69792", y = 2009, word = 'Positive') sentiment_info(url = "https://www.ratemyprofessors.com/ShowRatings.jsp?tid=69792", y = 2000, word = 'Negative') sentiment_info(url = "https://www.ratemyprofessors.com/ShowRatings.jsp?tid=69792", y = 2009, word = 'Tags')
sentiment_info
function using a word cloud.Examples:
sentiment_plot(url = "https://www.ratemyprofessors.com/ShowRatings.jsp?tid=69792", y = 2009, word = 'Positive')
ratings_info
Examples:
ratings_info("https://www.ratemyprofessors.com/ShowRatings.jsp?tid=1129448", y=2009)
ratings_plot
ratings_plot("https://www.ratemyprofessors.com/ShowRatings.jsp?tid=1129448", y=2009)
runExample
We included different tests for each function to make sure that they work properly as we expect.
The test coverage of the package is 98%.
The only function that is not tested is the runExample
function, which is used to launch the Shiny dashboard.
Here is the set of things we checked for each function in general:
Each function is documented thoroughly. The set of information included in each function is as below:
The website is launched and includes references, examples, and other useful information like this vignette on how to use this package.
As introduced before, the runExample
function is used to launch our well-designed Shiny dashboard.
The dashboard is highly comprehensive and user-friendly.
Most importantly, it utilizes and shows all the functionalities discussed so far in an interactive way.
We include some screenshots of the Shiny dashboard below.
knitr::include_graphics('ShinyHome.png')
knitr::include_graphics('ShinyWordcloud.png')
knitr::include_graphics('ShinyRatings.png')
Here are the future steps to make this package more comprehensive.
Adding campus evaluation to the analysis as well as the Shiny dashboard.
Incorporating correlation analysis and outlier detection:
Relation between the comments and grades
Incorporate likes and dislikes into the analysis to emphasize the value of comments.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.