Read movies csv data into a dataframe

movies <-read.csv(file = 'C:/temp/movies.csv', header = FALSE, sep = ",")

Initial data has generic column names

str(movies)
## 'data.frame':    30 obs. of  3 variables:
##  $ V1: Factor w/ 6 levels "Avatar","Black Panther",..: 1 6 3 4 2 5 1 6 3 4 ...
##  $ V2: Factor w/ 5 levels "Andy","Anthony",..: 5 5 5 5 5 5 2 2 2 2 ...
##  $ V3: int  5 3 3 5 4 5 5 5 4 4 ...

Add headers

names(movies)<- c('Movie','Name','Rating')

Table now has headers

str(movies)
## 'data.frame':    30 obs. of  3 variables:
##  $ Movie : Factor w/ 6 levels "Avatar","Black Panther",..: 1 6 3 4 2 5 1 6 3 4 ...
##  $ Name  : Factor w/ 5 levels "Andy","Anthony",..: 5 5 5 5 5 5 2 2 2 2 ...
##  $ Rating: int  5 3 3 5 4 5 5 5 4 4 ...
head(movies)
##                 Movie  Name Rating
## 1              Avatar Nancy      5
## 2 Saving Private Ryan Nancy      3
## 3   Coming To America Nancy      3
## 4                 Elf Nancy      5
## 5       Black Panther Nancy      4
## 6    Independence Day Nancy      5

Graphs of Movie Ratings

tmovies<-table(movies$Movie, movies$Rating)
barplot(tmovies, main="Movie Ratings",
  xlab="Ratings", col=c("darkblue","red", "yellow", "orange", "black", "green"),
  legend = rownames(tmovies), beside = TRUE) 

attach(movies)
plot(Movie,Rating, data=movies,
   main="Movie Ratings")