library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.1
## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.1
## ✔ purrr 1.0.4
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
movies<- read.csv(file="IMDBMovies.csv")
is.data.frame(movies)
## [1] TRUE
colnames(movies)
## [1] "Title" "Genre" "Description" "Director" "Actors"
## [6] "Year" "Runtime" "Rating"
Actionmovies_2010 <- filter(movies, Year==2010, Genre =="Action")
nrow(Actionmovies_2010)
## [1] 23
sorted_actionmovies <-Actionmovies_2010[order(-Actionmovies_2010$Rating),]
sorted_actionmovies2010 <-sorted_actionmovies[c("Title","Rating", "Runtime")]
print(sorted_actionmovies2010) [1:10,]
## Title Rating Runtime
## 1 Inception 8.8 148
## 18 The Fighter 7.8 116
## 3 Kick-Ass 7.7 117
## 2 Scott Pilgrim vs. the World 7.5 112
## 14 RED 7.1 111
## 6 Iron Man 2 7.0 124
## 9 The Book of Eli 6.9 118
## 12 Tron 6.8 125
## 17 The A-Team 6.8 117
## 20 Unstoppable 6.8 98
## 5 Robin Hood 6.7 140
## 8 The Other Guys 6.7 107
## 19 Prince of Persia: The Sands of Time 6.6 116
## 10 The Expendables 6.5 103
## 15 Faster 6.5 98
## 4 Predators 6.4 107
## 7 Salt 6.4 100
## 21 Centurion 6.4 97
## 16 The Karate Kid 6.2 140
## 23 Resident Evil: Afterlife 5.9 97
## 11 Clash of the Titans 5.8 106
## 22 Legion 5.2 100
## 13 The Last Airbender 4.2 103
## Title Rating Runtime
## 1 Inception 8.8 148
## 18 The Fighter 7.8 116
## 3 Kick-Ass 7.7 117
## 2 Scott Pilgrim vs. the World 7.5 112
## 14 RED 7.1 111
## 6 Iron Man 2 7.0 124
## 9 The Book of Eli 6.9 118
## 12 Tron 6.8 125
## 17 The A-Team 6.8 117
## 20 Unstoppable 6.8 98
This document presents a curated dataset of movies released in the year 2010. The selection has been carefully filtered based on two key criteria: audience rating and runtime, focusing on showcasing only the highest-rated and most impactful films of that year. Through this analysis, we aim to highlight the standout movies that not only received critical acclaim but also maintained an engaging and effective runtime.
Actionmovies_graphic<- subset(sorted_actionmovies, Year==2010)
ggplot(sorted_actionmovies2010, aes(x=Rating, y=Runtime, color=Rating)) +
geom_point()+
scale_color_gradient(low="blue", high="green")
Additionally, the document features a point chart that visualizes the relationship between movie ratings and runtimes, allowing for a clear and intuitive understanding of how these two variables interact. This visualization provides insights into whether longer films tend to receive higher ratings or if shorter, more concise productions were favored in 2010.