GithubHelp home page GithubHelp logo

profrate's Introduction

ProfRate

R-CMD-check Codecov test coverage License: MIT

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.

Installation

You can install the development version of ProfRate with:

  1. Install from GitHub:
### install.packages("devtools")
devtools::install_github("m-fili/ProfRate")
  1. Install from local: Download the 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.

Example

This basic example shows you how to retrieve and visualize the data using ProfRate.

### Load library
library(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.

runExample()

profrate's People

Contributors

yuhangtom avatar m-fili avatar danyangzhang avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.