library(tidyverse)
## -- Attaching packages ------------------------------------------------------------------------------------ tidyverse 1.2.1 --
## v ggplot2 2.2.1 v purrr 0.2.4
## v tibble 1.4.1 v dplyr 0.7.4
## v tidyr 0.7.2 v stringr 1.2.0
## v readr 1.1.1 v forcats 0.2.0
## -- Conflicts --------------------------------------------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(magick)
## Linking to ImageMagick 6.9.9.14
## Enabled features: cairo, freetype, fftw, ghostscript, lcms, pango, rsvg, webp
## Disabled features: fontconfig, x11
library(RMySQL)
## Loading required package: DBI
Requirement: Created Database CUNY_DATA607, user ‘DATA607User’ and 3 tables: Movie, Reviewer, Rating
Note : SQL Scripts provided separately (github link)
Once the connection is established, view the tables.
mydb =dbConnect(MySQL(),user='DATA607User',password=mypassword,dbname='CUNY_DATA607',host='localhost')
dbListTables(mydb)
## [1] "movie" "rating" "reviewer"
Select the tables: movie, reviwer and ratings and store the resultse in their respective data frames
movie_rs = dbSendQuery(mydb, 'select * from movie')
movie_df <- fetch(movie_rs)
movie_df
## movie_id movie_name
## 1 1 The LEGO Batman Movie
## 2 2 Transformers: The Last Knight
## 3 3 The Boss Baby
## 4 4 Hidden Figures
## 5 5 Star Wars: The Last Jedi
## 6 6 Wonder Woman
reviewer_rs = dbSendQuery(mydb, 'select * from reviewer')
reviewer_df <- fetch(reviewer_rs)
reviewer_df
## reviewer_id reviewer_name gender
## 1 1 Nick M
## 2 2 Betsy F
## 3 3 Andy M
## 4 4 Jeff M
## 5 5 Ruth F
rating_rs = dbSendQuery(mydb, 'select * from rating')
rating_df <- fetch(rating_rs)
head(rating_df,10)
## reviewer_id movie_id rating
## 1 1 1 6.5
## 2 1 2 6.0
## 3 1 3 7.0
## 4 1 4 8.0
## 5 1 5 9.0
## 6 1 6 7.5
## 7 2 1 7.0
## 8 2 2 6.5
## 9 2 3 7.0
## 10 2 4 8.5
reviewer_movie_rating <- left_join(movie_df,rating_df,by.x ="movie_id",by.y = "movie_id")
## Joining, by = "movie_id"
head(reviewer_movie_rating,10)
## movie_id movie_name reviewer_id rating
## 1 1 The LEGO Batman Movie 1 6.5
## 2 1 The LEGO Batman Movie 2 7.0
## 3 1 The LEGO Batman Movie 3 7.7
## 4 1 The LEGO Batman Movie 4 7.5
## 5 1 The LEGO Batman Movie 5 7.0
## 6 2 Transformers: The Last Knight 1 6.0
## 7 2 Transformers: The Last Knight 2 6.5
## 8 2 Transformers: The Last Knight 3 6.8
## 9 2 Transformers: The Last Knight 4 6.5
## 10 2 Transformers: The Last Knight 5 6.5
movie_rating <- reviewer_movie_rating %>%
group_by(movie_name,movie_id) %>%
summarize(reviewer_rating =mean(rating))
movie_rating
## # A tibble: 6 x 3
## # Groups: movie_name [?]
## movie_name movie_id reviewer_rating
## <chr> <int> <dbl>
## 1 Hidden Figures 4 7.90
## 2 Star Wars: The Last Jedi 5 7.30
## 3 The Boss Baby 3 7.20
## 4 The LEGO Batman Movie 1 7.14
## 5 Transformers: The Last Knight 2 6.46
## 6 Wonder Woman 6 7.90
movie_rating %>%
arrange(desc(reviewer_rating))
## # A tibble: 6 x 3
## # Groups: movie_name [6]
## movie_name movie_id reviewer_rating
## <chr> <int> <dbl>
## 1 Hidden Figures 4 7.90
## 2 Wonder Woman 6 7.90
## 3 Star Wars: The Last Jedi 5 7.30
## 4 The Boss Baby 3 7.20
## 5 The LEGO Batman Movie 1 7.14
## 6 Transformers: The Last Knight 2 6.46
Use omdbapi to fetch the movie data and associated details.
First obtaint he API key by registering at http://www.omdbapi.com/apikey.aspx
Now install devtools::install_github(“hrbrmstr/omdbapi”)
Note : Please activate the API key (key activation link received via email)
library(omdbapi)
#Checking omdbapi data for movie name "Hidden Figures"
hidden_figrures <- find_by_title("Hidden Figures",api_key =myomdbapiKey,year_of_release = '2016')
colnames(hidden_figrures)
## [1] "Title" "Year" "Rated" "Released" "Runtime"
## [6] "Genre" "Director" "Writer" "Actors" "Plot"
## [11] "Language" "Country" "Awards" "Poster" "Ratings"
## [16] "Metascore" "imdbRating" "imdbVotes" "imdbID" "Type"
## [21] "DVD" "BoxOffice" "Production" "Website" "Response"
hidden_figrures
## # A tibble: 3 x 25
## Title Year Rated Released Runti~ Genre Dire~ Writ~ Acto~ Plot Lang~
## <chr> <chr> <chr> <date> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
## 1 Hidde~ 2016 PG 2017-01-06 127 m~ Biog~ Theo~ Alli~ Tara~ The ~ Engl~
## 2 Hidde~ 2016 PG 2017-01-06 127 m~ Biog~ Theo~ Alli~ Tara~ The ~ Engl~
## 3 Hidde~ 2016 PG 2017-01-06 127 m~ Biog~ Theo~ Alli~ Tara~ The ~ Engl~
## # ... with 14 more variables: Country <chr>, Awards <chr>, Poster <chr>,
## # Ratings <list>, Metascore <chr>, imdbRating <dbl>, imdbVotes <dbl>,
## # imdbID <chr>, Type <chr>, DVD <date>, BoxOffice <chr>, Production
## # <chr>, Website <chr>, Response <chr>
Now, we understand that how omdbapi works. Let’s create a generic function to search the movie details using omdbapi for the movies stored in our MySQL database.
library(omdbapi)
#generic function to fetch movie data using omdbapi
searchIMDBMovieDetails <- function(exp) {
df_mv <- find_by_title(exp,api_key =myomdbapiKey)
select(df_mv,Title,imdbID,Year,Genre,imdbRating,imdbVotes,BoxOffice,Director,Poster)
}
#creating a dataframe instance to store movie data fetched using omdbapi
movieDetails_df <- data.frame(
Title=character(),
imdbID=numeric(),
Year = as.Date(character()),
Genre=character(),
imdbRating = numeric(),
imdbVotes=character(),
BoxOffice=character(),
Director=character(),
Poster=character(),
stringsAsFactors=FALSE)
i <- 1
for (title in movie_df$movie_name){
if(length(movieDetails_df)>1) {
movieDetails_df <- rbind(movieDetails_df,searchIMDBMovieDetails(movie_df$movie_name[i]))
}
i <- i + 1
}
movieDetails_df
## # A tibble: 18 x 9
## Title imdbID Year Genre imdbR~ imdbV~ BoxO~ Dire~ Poster
## <chr> <chr> <chr> <chr> <dbl> <dbl> <chr> <chr> <chr>
## 1 The LE~ tt411~ 2017 Animat~ 7.30 93000 $175~ Chri~ https://images-~
## 2 The LE~ tt411~ 2017 Animat~ 7.30 93000 $175~ Chri~ https://images-~
## 3 The LE~ tt411~ 2017 Animat~ 7.30 93000 $175~ Chri~ https://images-~
## 4 Transf~ tt337~ 2017 Action~ 5.20 88639 $130~ Mich~ https://images-~
## 5 Transf~ tt337~ 2017 Action~ 5.20 88639 $130~ Mich~ https://images-~
## 6 Transf~ tt337~ 2017 Action~ 5.20 88639 $130~ Mich~ https://images-~
## 7 The Bo~ tt387~ 2017 Animat~ 6.40 69579 $174~ Tom ~ https://images-~
## 8 The Bo~ tt387~ 2017 Animat~ 6.40 69579 $174~ Tom ~ https://images-~
## 9 The Bo~ tt387~ 2017 Animat~ 6.40 69579 $174~ Tom ~ https://images-~
## 10 Hidden~ tt484~ 2016 Biogra~ 7.80 139476 $169~ Theo~ https://images-~
## 11 Hidden~ tt484~ 2016 Biogra~ 7.80 139476 $169~ Theo~ https://images-~
## 12 Hidden~ tt484~ 2016 Biogra~ 7.80 139476 $169~ Theo~ https://images-~
## 13 Star W~ tt252~ 2017 Action~ 7.50 288267 $572~ Rian~ https://images-~
## 14 Star W~ tt252~ 2017 Action~ 7.50 288267 $572~ Rian~ https://images-~
## 15 Star W~ tt252~ 2017 Action~ 7.50 288267 $572~ Rian~ https://images-~
## 16 Wonder~ tt045~ 2017 Action~ 7.50 370886 $412~ Patt~ https://images-~
## 17 Wonder~ tt045~ 2017 Action~ 7.50 370886 $412~ Patt~ https://images-~
## 18 Wonder~ tt045~ 2017 Action~ 7.50 370886 $412~ Patt~ https://images-~
imdb_movie_box <- unique(movieDetails_df)
imdb_movie_box
## # A tibble: 6 x 9
## Title imdbID Year Genre imdbR~ imdbV~ BoxO~ Dire~ Poster
## <chr> <chr> <chr> <chr> <dbl> <dbl> <chr> <chr> <chr>
## 1 The LEG~ tt411~ 2017 Animat~ 7.30 93000 $175~ Chri~ https://images-~
## 2 Transfo~ tt337~ 2017 Action~ 5.20 88639 $130~ Mich~ https://images-~
## 3 The Bos~ tt387~ 2017 Animat~ 6.40 69579 $174~ Tom ~ https://images-~
## 4 Hidden ~ tt484~ 2016 Biogra~ 7.80 139476 $169~ Theo~ https://images-~
## 5 Star Wa~ tt252~ 2017 Action~ 7.50 288267 $572~ Rian~ https://images-~
## 6 Wonder ~ tt045~ 2017 Action~ 7.50 370886 $412~ Patt~ https://images-~
final_imdb_movie_df <- merge(movie_df,imdb_movie_box, by.x = 'movie_name',by.y = 'Title',drop=F )
final_imdb_movie_df
## movie_name movie_id imdbID Year
## 1 Hidden Figures 4 tt4846340 2016
## 2 Star Wars: The Last Jedi 5 tt2527336 2017
## 3 The Boss Baby 3 tt3874544 2017
## 4 The LEGO Batman Movie 1 tt4116284 2017
## 5 Transformers: The Last Knight 2 tt3371366 2017
## 6 Wonder Woman 6 tt0451279 2017
## Genre imdbRating imdbVotes BoxOffice
## 1 Biography, Drama, History 7.8 139476 $169,385,416
## 2 Action, Adventure, Fantasy 7.5 288267 $572,691,546
## 3 Animation, Comedy, Family 6.4 69579 $174,996,080
## 4 Animation, Action, Adventure 7.3 93000 $175,686,290
## 5 Action, Adventure, Sci-Fi 5.2 88639 $130,104,634
## 6 Action, Adventure, Fantasy 7.5 370886 $412,400,625
## Director
## 1 Theodore Melfi
## 2 Rian Johnson
## 3 Tom McGrath
## 4 Chris McKay
## 5 Michael Bay
## 6 Patty Jenkins
## Poster
## 1 https://images-na.ssl-images-amazon.com/images/M/MV5BMzg2Mzg4YmUtNDdkNy00NWY1LWE3NmEtZWMwNGNlMzE5YzU3XkEyXkFqcGdeQXVyMjA5MTIzMjQ@._V1_SX300.jpg
## 2 https://images-na.ssl-images-amazon.com/images/M/MV5BMjQ1MzcxNjg4N15BMl5BanBnXkFtZTgwNzgwMjY4MzI@._V1_SX300.jpg
## 3 https://images-na.ssl-images-amazon.com/images/M/MV5BMTg5MzUxNzgxNV5BMl5BanBnXkFtZTgwMTM2NzQ3MjI@._V1_SX300.jpg
## 4 https://images-na.ssl-images-amazon.com/images/M/MV5BMTcyNTEyOTY0M15BMl5BanBnXkFtZTgwOTAyNzU3MDI@._V1_SX300.jpg
## 5 https://images-na.ssl-images-amazon.com/images/M/MV5BMTk3OTI3MDk4N15BMl5BanBnXkFtZTgwNDg2ODIyMjI@._V1_SX300.jpg
## 6 https://images-na.ssl-images-amazon.com/images/M/MV5BNDFmZjgyMTEtYTk5MC00NmY0LWJhZjktOWY2MzI5YjkzODNlXkEyXkFqcGdeQXVyMDA4NzMyOA@@._V1_SX300.jpg
final_imdb_movie_df <- final_imdb_movie_df %>%
arrange(desc(imdbRating))
final_imdb_movie_df$Poster[2]
## [1] "https://images-na.ssl-images-amazon.com/images/M/MV5BMjQ1MzcxNjg4N15BMl5BanBnXkFtZTgwNzgwMjY4MzI@._V1_SX300.jpg"
getMoviePoster <- function(movieID){
poster[movieID] <- final_imdb_movie_df$Poster[movieID]
}
movie_poster <- select(final_imdb_movie_df,Poster)
movie_poster
## Poster
## 1 https://images-na.ssl-images-amazon.com/images/M/MV5BMzg2Mzg4YmUtNDdkNy00NWY1LWE3NmEtZWMwNGNlMzE5YzU3XkEyXkFqcGdeQXVyMjA5MTIzMjQ@._V1_SX300.jpg
## 2 https://images-na.ssl-images-amazon.com/images/M/MV5BMjQ1MzcxNjg4N15BMl5BanBnXkFtZTgwNzgwMjY4MzI@._V1_SX300.jpg
## 3 https://images-na.ssl-images-amazon.com/images/M/MV5BNDFmZjgyMTEtYTk5MC00NmY0LWJhZjktOWY2MzI5YjkzODNlXkEyXkFqcGdeQXVyMDA4NzMyOA@@._V1_SX300.jpg
## 4 https://images-na.ssl-images-amazon.com/images/M/MV5BMTcyNTEyOTY0M15BMl5BanBnXkFtZTgwOTAyNzU3MDI@._V1_SX300.jpg
## 5 https://images-na.ssl-images-amazon.com/images/M/MV5BMTg5MzUxNzgxNV5BMl5BanBnXkFtZTgwMTM2NzQ3MjI@._V1_SX300.jpg
## 6 https://images-na.ssl-images-amazon.com/images/M/MV5BMTk3OTI3MDk4N15BMl5BanBnXkFtZTgwNDg2ODIyMjI@._V1_SX300.jpg
stackPoster <- image_read(movie_poster$Poster)
posterDisplay <- image_append(stackPoster)
(posterDisplay)
imdb_rt <- select(final_imdb_movie_df,movie_id,imdbRating,imdbVotes,BoxOffice)
imdb_rt
## movie_id imdbRating imdbVotes BoxOffice
## 1 4 7.8 139476 $169,385,416
## 2 5 7.5 288267 $572,691,546
## 3 6 7.5 370886 $412,400,625
## 4 1 7.3 93000 $175,686,290
## 5 3 6.4 69579 $174,996,080
## 6 2 5.2 88639 $130,104,634
left_join(movie_rating,select(final_imdb_movie_df,movie_id,imdbRating,imdbVotes,BoxOffice), by.x ='movie_id', by.y = 'movie_id' )
## Joining, by = "movie_id"
## # A tibble: 6 x 6
## # Groups: movie_name [?]
## movie_name movie_id reviewer~ imdbRa~ imdbVo~ BoxOff~
## <chr> <int> <dbl> <dbl> <dbl> <chr>
## 1 Hidden Figures 4 7.90 7.80 139476 $169,3~
## 2 Star Wars: The Last Jedi 5 7.30 7.50 288267 $572,6~
## 3 The Boss Baby 3 7.20 6.40 69579 $174,9~
## 4 The LEGO Batman Movie 1 7.14 7.30 93000 $175,6~
## 5 Transformers: The Last Knight 2 6.46 5.20 88639 $130,1~
## 6 Wonder Woman 6 7.90 7.50 370886 $412,4~
reviewer_boxofc_rating <- left_join(movie_rating,imdb_rt, by.x ='movie_id', by.y = 'movie_id' )
## Joining, by = "movie_id"
reviewer_boxofc_rating
## # A tibble: 6 x 6
## # Groups: movie_name [?]
## movie_name movie_id reviewer~ imdbRa~ imdbVo~ BoxOff~
## <chr> <int> <dbl> <dbl> <dbl> <chr>
## 1 Hidden Figures 4 7.90 7.80 139476 $169,3~
## 2 Star Wars: The Last Jedi 5 7.30 7.50 288267 $572,6~
## 3 The Boss Baby 3 7.20 6.40 69579 $174,9~
## 4 The LEGO Batman Movie 1 7.14 7.30 93000 $175,6~
## 5 Transformers: The Last Knight 2 6.46 5.20 88639 $130,1~
## 6 Wonder Woman 6 7.90 7.50 370886 $412,4~
reviewer_boxofc_rating <- mutate(reviewer_boxofc_rating, rating_diff=(reviewer_rating-imdbRating))
reviewer_boxofc_rating
## # A tibble: 6 x 7
## # Groups: movie_name [6]
## movie_name movie_id revie~ imdbR~ imdbV~ BoxO~ ratin~
## <chr> <int> <dbl> <dbl> <dbl> <chr> <dbl>
## 1 Hidden Figures 4 7.90 7.80 139476 $169~ 0.100
## 2 Star Wars: The Last Jedi 5 7.30 7.50 288267 $572~ -0.200
## 3 The Boss Baby 3 7.20 6.40 69579 $174~ 0.800
## 4 The LEGO Batman Movie 1 7.14 7.30 93000 $175~ -0.160
## 5 Transformers: The Last Knight 2 6.46 5.20 88639 $130~ 1.26
## 6 Wonder Woman 6 7.90 7.50 370886 $412~ 0.400
ggplot(data = reviewer_boxofc_rating, aes(x = movie_id, y =rating_diff,fill=rating_diff))+
geom_bar(stat = "summary",fun.y='mean') +
stat_summary(aes(label=round(..y..,2)), fun.y=mean, geom="text", vjust = 1.1) +
scale_x_discrete(limit = reviewer_boxofc_rating$movie_id) +
ylab("Rating diff : my reviewer rating Vs. imdb rating")+
ggtitle("Rating Difference: My Reviewer Rating Vs.IMDB Rating ")
ggplot(data = final_imdb_movie_df, aes(y = imdbRating, x = movie_name,))+
geom_bar(stat = "identity",position="dodge",fill=final_imdb_movie_df$imdbVotes) +
ylab("Movie Rating")+
xlab("Movie Name")+
ggtitle("IMDB Movie Rating")+
coord_flip()
ggplot(data = final_imdb_movie_df, aes(x = final_imdb_movie_df$Genre))+
geom_bar(aes(fill=final_imdb_movie_df$Genre))+
ylab("Movie Count")+
xlab("Genre")+
ggtitle("Movie Genre")+
coord_flip()
ggplot(data = reviewer_boxofc_rating)+
geom_smooth(aes(x = movie_id, y =reviewer_rating, se = F,show.legend = T,colour="my_reviewer_rating"))+
geom_smooth(aes(x = movie_id, y =imdbRating, se = F,show.legend = T,colour="imdbRating"))+
scale_x_discrete(limit = reviewer_boxofc_rating$movie_id)+
scale_colour_manual(name="legend", values=c("blue", "red"))+
ylab("Movie Rating")+
xlab("Movie ID")+
ggtitle("My Reviewer Rating Vs. IMDB Rating")
## Warning: Ignoring unknown aesthetics: se, show.legend
## Warning: Ignoring unknown aesthetics: se, show.legend
## `geom_smooth()` using method = 'loess'
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : Chernobyl! trL>n 6
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : Chernobyl! trL>n 6
## Warning in sqrt(sum.squares/one.delta): NaNs produced
## Warning in stats::qt(level/2 + 0.5, pred$df): NaNs produced
## `geom_smooth()` using method = 'loess'
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : Chernobyl! trL>n 6
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## parametric, : Chernobyl! trL>n 6
## Warning in sqrt(sum.squares/one.delta): NaNs produced
## Warning in stats::qt(level/2 + 0.5, pred$df): NaNs produced
movie_boxoffice_df<- select(reviewer_boxofc_rating,as.numeric(factor(reviewer_boxofc_rating$BoxOffice)))
movie_boxoffice_performance <- movie_boxoffice_df %>%
arrange(desc(BoxOffice))
movie_boxoffice_performance
## # A tibble: 6 x 6
## # Groups: movie_name [6]
## movie_id BoxOffice reviewer_rating imdbRating movie_name imdbVo~
## <int> <chr> <dbl> <dbl> <chr> <dbl>
## 1 5 $572,691,546 7.30 7.50 Star Wars: The~ 288267
## 2 6 $412,400,625 7.90 7.50 Wonder Woman 370886
## 3 1 $175,686,290 7.14 7.30 The LEGO Batma~ 93000
## 4 3 $174,996,080 7.20 6.40 The Boss Baby 69579
## 5 4 $169,385,416 7.90 7.80 Hidden Figures 139476
## 6 2 $130,104,634 6.46 5.20 Transformers: ~ 88639
ggplot(data = movie_boxoffice_performance, aes(x = movie_name, y =BoxOffice,fill=movie_boxoffice_performance$BoxOffice))+
geom_bar(stat = "summary",fun.y='mean')+
ylab("Box Office Collection")+
xlab("Movie Name")+
ggtitle("Box Office Performance")
final_imdb_movie_df
## movie_name movie_id imdbID Year
## 1 Hidden Figures 4 tt4846340 2016
## 2 Star Wars: The Last Jedi 5 tt2527336 2017
## 3 Wonder Woman 6 tt0451279 2017
## 4 The LEGO Batman Movie 1 tt4116284 2017
## 5 The Boss Baby 3 tt3874544 2017
## 6 Transformers: The Last Knight 2 tt3371366 2017
## Genre imdbRating imdbVotes BoxOffice
## 1 Biography, Drama, History 7.8 139476 $169,385,416
## 2 Action, Adventure, Fantasy 7.5 288267 $572,691,546
## 3 Action, Adventure, Fantasy 7.5 370886 $412,400,625
## 4 Animation, Action, Adventure 7.3 93000 $175,686,290
## 5 Animation, Comedy, Family 6.4 69579 $174,996,080
## 6 Action, Adventure, Sci-Fi 5.2 88639 $130,104,634
## Director
## 1 Theodore Melfi
## 2 Rian Johnson
## 3 Patty Jenkins
## 4 Chris McKay
## 5 Tom McGrath
## 6 Michael Bay
## Poster
## 1 https://images-na.ssl-images-amazon.com/images/M/MV5BMzg2Mzg4YmUtNDdkNy00NWY1LWE3NmEtZWMwNGNlMzE5YzU3XkEyXkFqcGdeQXVyMjA5MTIzMjQ@._V1_SX300.jpg
## 2 https://images-na.ssl-images-amazon.com/images/M/MV5BMjQ1MzcxNjg4N15BMl5BanBnXkFtZTgwNzgwMjY4MzI@._V1_SX300.jpg
## 3 https://images-na.ssl-images-amazon.com/images/M/MV5BNDFmZjgyMTEtYTk5MC00NmY0LWJhZjktOWY2MzI5YjkzODNlXkEyXkFqcGdeQXVyMDA4NzMyOA@@._V1_SX300.jpg
## 4 https://images-na.ssl-images-amazon.com/images/M/MV5BMTcyNTEyOTY0M15BMl5BanBnXkFtZTgwOTAyNzU3MDI@._V1_SX300.jpg
## 5 https://images-na.ssl-images-amazon.com/images/M/MV5BMTg5MzUxNzgxNV5BMl5BanBnXkFtZTgwMTM2NzQ3MjI@._V1_SX300.jpg
## 6 https://images-na.ssl-images-amazon.com/images/M/MV5BMTk3OTI3MDk4N15BMl5BanBnXkFtZTgwNDg2ODIyMjI@._V1_SX300.jpg
Conclusion: The movie and rating data analysis leads to below results:
box_office_winner_poster <- image_read(movie_poster$Poster[2])
plot(box_office_winner_poster)
movie_with_maxVotes_poster <- image_read(movie_poster$Poster[3])
plot(movie_with_maxVotes_poster)
best_rated_movie_poster <- image_read(movie_poster$Poster[1])
plot(best_rated_movie_poster)