Assignment 2

Imported CSV file from GitHub that was originally exported from MySQL

theURL <- "https://raw.githubusercontent.com/wheremagichappens/an.dy/master/DATA607/Assignment-2/rating.csv"

rating <- read.table(theURL, header = FALSE, sep = ",", stringsAsFactors = FALSE)
names(rating) <-c("name","title","rating")

rating$name <- gsub("\n", "", rating$name)
rating$title <- gsub("\n", "", rating$title)

rating
##     name                    title rating
## 1    Ali                  Jumanji      4
## 2  Chris Star Wars: The Last Jedi      2
## 3  Chris                Lady Bird      3
## 4  Chris                  Jumanji      1
## 5  Chris                 The Post      3
## 6  Chris              Maze Runner      5
## 7   Jake                Lady Bird      5
## 8   Jake Star Wars: The Last Jedi      5
## 9   Jake                 The Post      4
## 10  Jake                  Jumanji      5
## 11  Jake              Maze Runner      5
## 12  Jake       The Shape of Water      1
## 13  Kate                Lady Bird      1
## 14   Kim Star Wars: The Last Jedi      2
## 15   Kim Star Wars: The Last Jedi      2
subset(rating, name == "Ali")
##   name   title rating
## 1  Ali Jumanji      4
str(rating)
## 'data.frame':    15 obs. of  3 variables:
##  $ name  : chr  "Ali" "Chris" "Chris" "Chris" ...
##  $ title : chr  "Jumanji" "Star Wars: The Last Jedi" "Lady Bird" "Jumanji" ...
##  $ rating: int  4 2 3 1 3 5 5 5 4 5 ...