plots in r

Plots in R are visual representations of data that help analysts and data scientists explore, analyze, and communicate insights. R offers a rich ecosystem of plotting functions and libraries, each designed for specific data visualization needs.

data<-read.csv("C:/Users/java/Desktop/datav.csv")
summary(data)
##  Poster_Link        Series_Title       Released_Year      Certificate       
##  Length:1000        Length:1000        Length:1000        Length:1000       
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##    Runtime             Genre            IMDB_Rating      Overview        
##  Length:1000        Length:1000        Min.   :7.600   Length:1000       
##  Class :character   Class :character   1st Qu.:7.700   Class :character  
##  Mode  :character   Mode  :character   Median :7.900   Mode  :character  
##                                        Mean   :7.949                     
##                                        3rd Qu.:8.100                     
##                                        Max.   :9.300                     
##                                                                          
##    Meta_score       Director            Star1              Star2          
##  Min.   : 28.00   Length:1000        Length:1000        Length:1000       
##  1st Qu.: 70.00   Class :character   Class :character   Class :character  
##  Median : 79.00   Mode  :character   Mode  :character   Mode  :character  
##  Mean   : 77.97                                                           
##  3rd Qu.: 87.00                                                           
##  Max.   :100.00                                                           
##  NA's   :157                                                              
##     Star3              Star4            No_of_Votes         Gross          
##  Length:1000        Length:1000        Min.   :  25088   Length:1000       
##  Class :character   Class :character   1st Qu.:  55526   Class :character  
##  Mode  :character   Mode  :character   Median : 138549   Mode  :character  
##                                        Mean   : 273693                     
##                                        3rd Qu.: 374161                     
##                                        Max.   :2343110                     
## 
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.2.3
ggplot(data = data) + labs(title ="movies Data Plot")

str(data)
## 'data.frame':    1000 obs. of  16 variables:
##  $ Poster_Link  : chr  "https://m.media-amazon.com/images/M/MV5BMDFkYTc0MGEtZmNhMC00ZDIzLWFmNTEtODM1ZmRlYWMwMWFmXkEyXkFqcGdeQXVyMTMxODk"| __truncated__ "https://m.media-amazon.com/images/M/MV5BM2MyNjYxNmUtYTAwNi00MTYxLWJmNWYtYzZlODY3ZTk3OTFlXkEyXkFqcGdeQXVyNzkwMjQ"| __truncated__ "https://m.media-amazon.com/images/M/MV5BMTMxNTMwODM0NF5BMl5BanBnXkFtZTcwODAyMTk2Mw@@._V1_UX67_CR0,0,67,98_AL_.jpg" "https://m.media-amazon.com/images/M/MV5BMWMwMGQzZTItY2JlNC00OWZiLWIyMDctNDk2ZDQ2YjRjMWQ0XkEyXkFqcGdeQXVyNzkwMjQ"| __truncated__ ...
##  $ Series_Title : chr  "The Shawshank Redemption" "The Godfather" "The Dark Knight" "The Godfather: Part II" ...
##  $ Released_Year: chr  "1994" "1972" "2008" "1974" ...
##  $ Certificate  : chr  "A" "A" "UA" "A" ...
##  $ Runtime      : chr  "142 min" "175 min" "152 min" "202 min" ...
##  $ Genre        : chr  "Drama" "Crime, Drama" "Action, Crime, Drama" "Crime, Drama" ...
##  $ IMDB_Rating  : num  9.3 9.2 9 9 9 8.9 8.9 8.9 8.8 8.8 ...
##  $ Overview     : chr  "Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency." "An organized crime dynasty's aging patriarch transfers control of his clandestine empire to his reluctant son." "When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, Batman must accept one of th"| __truncated__ "The early life and career of Vito Corleone in 1920s New York City is portrayed, while his son, Michael, expands"| __truncated__ ...
##  $ Meta_score   : int  80 100 84 90 96 94 94 94 74 66 ...
##  $ Director     : chr  "Frank Darabont" "Francis Ford Coppola" "Christopher Nolan" "Francis Ford Coppola" ...
##  $ Star1        : chr  "Tim Robbins" "Marlon Brando" "Christian Bale" "Al Pacino" ...
##  $ Star2        : chr  "Morgan Freeman" "Al Pacino" "Heath Ledger" "Robert De Niro" ...
##  $ Star3        : chr  "Bob Gunton" "James Caan" "Aaron Eckhart" "Robert Duvall" ...
##  $ Star4        : chr  "William Sadler" "Diane Keaton" "Michael Caine" "Diane Keaton" ...
##  $ No_of_Votes  : int  2343110 1620367 2303232 1129952 689845 1642758 1826188 1213505 2067042 1854740 ...
##  $ Gross        : chr  "2,83,41,469" "13,49,66,411" "53,48,58,444" "5,73,00,000" ...
ggplot(data = data, aes(x = No_of_Votes , y =IMDB_Rating, col = Gross ))+labs(title = "Movie Data Plot")

ggplot(data = data, aes(x =IMDB_Rating  , y =No_of_Votes , size=No_of_Votes)) +
  geom_point() +
  labs(title = " Movie.Rating vsvotes", x = " Movie.Rating", y = "votes ")

ggplot(data = data, aes(x = IMDB_Rating  , y = No_of_Votes    , size =  )) +
geom_point() +
labs(title = "Movie Rating vs  votes ", x = "Movie Rating", y = " votes  ")

data$votes<-factor(data$No_of_Votes)
ggplot(data, aes(x = factor(No_of_Votes), y = IMDB_Rating)) +
  geom_point()

ggplot(data = data, aes(x=as.factor(Certificate), fill=Certificate)) + 
       geom_bar(stat="count")

bx <- ggplot(data = data, aes(x = factor(Released_Year ), y = Runtime)) + 
  geom_boxplot(fill = "blue") + 
  ggtitle("Year.of.Release") +
  ylab(" Year.of.Release ") + 
  xlab(" Run.time") 
bx

ggplot(data, aes(x = as.factor( IMDB_Rating), y =  No_of_Votes  , col =  IMDB_Rating)) +
  geom_jitter() +
  facet_grid(. ~  IMDB_Rating)