knitr::opts_chunk$set(echo = TRUE)

Introduction

Netflix merupakan platform yang menawarkan film dan TV show berbayar bagi para pelanggannya. Setiap tahunnya film dan TV Show ditambahkan ke platform Netfix sebagai alternatif bagi pecinta film dan TV Show selain tontonan di Bioskop.

Business Problem

Pada LBB ini akan dilakukan analisa terhadap :

1.Komposisi TV Show dan Film di Netflix

2.Negara produsen konten terbesar di Netflix

3.Actor yang paling banyak sebagai pemeran di TV dan Film di Netflix

Analisa ini bertujuan sebagai bahan dalam pengembangan konten di Netflix pada masa mendatang agar Netflix dapat bersaing dengan OTT lainya.

Data Wrangling

Pada bagian ini akan dilakukan read data netflix_titles yang berisi judul film dan tv show yang ada di netflix dari tahun 2008 -2021, actor yang ada di netflix, negara asal tv show dan film.

Data netflix_titles dapat diakses di kaggle

netflix3 <- read.csv("netflix_titles.csv")
str(netflix3)
## 'data.frame':    8807 obs. of  12 variables:
##  $ show_id     : chr  "s1" "s2" "s3" "s4" ...
##  $ type        : chr  "Movie" "TV Show" "TV Show" "TV Show" ...
##  $ title       : chr  "Dick Johnson Is Dead" "Blood & Water" "Ganglands" "Jailbirds New Orleans" ...
##  $ director    : chr  "Kirsten Johnson" "" "Julien Leclercq" "" ...
##  $ cast        : chr  "" "Ama Qamata, Khosi Ngema, Gail Mabalane, Thabang Molaba, Dillon Windvogel, Natasha Thahane, Arno Greeff, Xolile "| __truncated__ "Sami Bouajila, Tracy Gotoas, Samuel Jouy, Nabiha Akkari, Sofia Lesaffre, Salim Kechiouche, Noureddine Farihi, G"| __truncated__ "" ...
##  $ country     : chr  "United States" "South Africa" "" "" ...
##  $ date_added  : chr  "September 25, 2021" "September 24, 2021" "September 24, 2021" "September 24, 2021" ...
##  $ release_year: int  2020 2021 2021 2021 2021 2021 2021 1993 2021 2021 ...
##  $ rating      : chr  "PG-13" "TV-MA" "TV-MA" "TV-MA" ...
##  $ duration    : chr  "90 min" "2 Seasons" "1 Season" "1 Season" ...
##  $ listed_in   : chr  "Documentaries" "International TV Shows, TV Dramas, TV Mysteries" "Crime TV Shows, International TV Shows, TV Action & Adventure" "Docuseries, Reality TV" ...
##  $ description : chr  "As her father nears the end of his life, filmmaker Kirsten Johnson stages his death in inventive and comical wa"| __truncated__ "After crossing paths at a party, a Cape Town teen sets out to prove whether a private-school swimming star is h"| __truncated__ "To protect his family from a powerful drug lord, skilled thief Mehdi and his expert team of robbers are pulled "| __truncated__ "Feuds, flirtations and toilet talk go down among the incarcerated women at the Orleans Justice Center in New Or"| __truncated__ ...

Dari hasil diatas terdapat kolom yang belum sesuai tipe datanya, sehingga perlu di sesuaikan tipe datanya dengan menggunakan fungsi dplyr() lalu dilakukan pengecekan ulang dengan glimpse

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(lubridate)
## 
## Attaching package: 'lubridate'
## The following objects are masked from 'package:base':
## 
##     date, intersect, setdiff, union
netflix3<- netflix3 %>% 
  mutate(type = as.factor(type),
         country = as.character(country),
         rating = as.factor(rating))
netflix3$date_added <- as.Date(netflix3$date_added, format = "%B %d, %Y")
glimpse(netflix3)
## Rows: 8,807
## Columns: 12
## $ show_id      <chr> "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9", "s1…
## $ type         <fct> Movie, TV Show, TV Show, TV Show, TV Show, TV Show, Movie…
## $ title        <chr> "Dick Johnson Is Dead", "Blood & Water", "Ganglands", "Ja…
## $ director     <chr> "Kirsten Johnson", "", "Julien Leclercq", "", "", "Mike F…
## $ cast         <chr> "", "Ama Qamata, Khosi Ngema, Gail Mabalane, Thabang Mola…
## $ country      <chr> "United States", "South Africa", "", "", "India", "", "",…
## $ date_added   <date> 2021-09-25, 2021-09-24, 2021-09-24, 2021-09-24, 2021-09-…
## $ release_year <int> 2020, 2021, 2021, 2021, 2021, 2021, 2021, 1993, 2021, 202…
## $ rating       <fct> PG-13, TV-MA, TV-MA, TV-MA, TV-MA, TV-MA, PG, TV-MA, TV-1…
## $ duration     <chr> "90 min", "2 Seasons", "1 Season", "1 Season", "2 Seasons…
## $ listed_in    <chr> "Documentaries", "International TV Shows, TV Dramas, TV M…
## $ description  <chr> "As her father nears the end of his life, filmmaker Kirst…

Selanjutnya dilakukan pengecekan pada dataset netflix_titles untuk mengetahui apakah ada missing value di dataset netflix_titles

colSums(is.na(netflix3))
##      show_id         type        title     director         cast      country 
##            0            0            0            0            0            0 
##   date_added release_year       rating     duration    listed_in  description 
##           98            0            0            0            0            0

Berdasarkan pengecekan yang dilakukan, tidak ada missing value pada dataset, sehingga dapat di lanjutkan ke proses berikutnya yaitu menjawab tujuan analisa dengan menggunakan dataset netflix_titles

Data Analytics

Proportion of Content in Netflix

Pada bagian ini, analis ingin mengetahui informasi tentang berapa proporsi dari TV Show dan Movie di Netflix

prop.table(table(netflix3$type))
## 
##     Movie   TV Show 
## 0.6961508 0.3038492

Berdasarkan proporsi diatas, Movie memiliki proporsi yang paling besar yaitu 69 % dibandingkan dengan TV Show sebesar 31 %, dan dapat digambarkan dengan pie Chart berikut ini

graphics::pie(xtabs(~ type, netflix3))

Sum of Content based on Country

Pada bagian ini, menarik untuk mendapatkan informasi tentang negara mana yang merupakan produsen TV atau Movie terbanyak di platform netflix. Langkah yang dilakukan memisahkan data di kolom country karena terdapat lebih dari satu negara pada satu baris dan agregasi terhadap data

split_by_country <- strsplit(netflix3$country, split = ", ")
country_split <- data.frame(type = rep(netflix3$type, sapply(split_by_country, length)), country = unlist(split_by_country))
country_split$country <- as.character(gsub(",","", country_split$country))
head(country_split)
##      type       country
## 1   Movie United States
## 2 TV Show  South Africa
## 3 TV Show         India
## 4   Movie United States
## 5   Movie         Ghana
## 6   Movie  Burkina Faso

Setelah dilakukan split pada data country, selanjuttnya dibuat data frame yang meliputi data type dan country. pada tahap dibawah ini akan dibuat aggregasi data untuk mengetahui negara mana dengan produksi movie atau TV Show terbesar

library(dplyr)
type_agg <- na.omit(country_split) %>%
  group_by(country, type) %>%
  summarise(count = n())

topcountry_type <- reshape(data = data.frame(type_agg), 
             idvar = "country",
             v.names = "count",
             timevar = "type",
             direction = "wide") %>% 
  arrange(desc(count.Movie)) %>% top_n(5)
head(topcountry_type)
##          country count.Movie count.TV Show
## 1  United States        2752           938
## 2 United Kingdom         534           272
## 3         Canada         319           126
## 4          Japan         119           199
## 5    South Korea          61           170
names(topcountry_type)[2] <- "count_movie"
names(topcountry_type)[3] <- "count_tv_show"

Berdasarkan aggregasi yang dilakukan maka US merupakan produsen film dan Movie terbesar di Netflix dengan 2752 Movie dan 938 TV Show. Berikut adalah barplot untuk menggambarkan pesebaran data diatas

# barplot untuk Movie
graphics::barplot(xtabs(count_movie~ country, topcountry_type))

# barplot untuk tv show
graphics::barplot(xtabs(count_tv_show ~ country, topcountry_type))

Sum of Genre in Netflix

Pada bagian ini, analis ingin mengetahui genre apa yang sering muncul di netflix, berikut langkah yang dilakukan adalah memisahkan data di kolom listed in karena terdapat lebih dari satu genre pada satu kolom listed_in dan melakukan agregasi terhadap data

## Melakukan split pada character di kolom listed in

netflix_genres <- strsplit(netflix3$listed_in, split = ", ")

genres_listed_in <- data.frame(type = rep(netflix3$type, sapply(netflix_genres, length)), 
                               listed_in = unlist(netflix_genres))

genres_listed_in$listed_in <- as.character(gsub(",","",genres_listed_in$listed_in))
## Agregasi data, mengelompokkan berdasarkan genre
netflix_genres_listed <- genres_listed_in %>% 
  group_by(type, listed_in) %>% 
  summarise(count = n()) %>% 
  arrange(desc(count)) %>% top_n(10)
netflix_genres_listed
## # A tibble: 20 × 3
## # Groups:   type [2]
##    type    listed_in                count
##    <fct>   <chr>                    <int>
##  1 Movie   International Movies      2752
##  2 Movie   Dramas                    2427
##  3 Movie   Comedies                  1674
##  4 TV Show International TV Shows    1351
##  5 Movie   Documentaries              869
##  6 Movie   Action & Adventure         859
##  7 TV Show TV Dramas                  763
##  8 Movie   Independent Movies         756
##  9 Movie   Children & Family Movies   641
## 10 Movie   Romantic Movies            616
## 11 TV Show TV Comedies                581
## 12 Movie   Thrillers                  577
## 13 TV Show Crime TV Shows             470
## 14 TV Show Kids' TV                   451
## 15 TV Show Docuseries                 395
## 16 Movie   Music & Musicals           375
## 17 TV Show Romantic TV Shows          370
## 18 TV Show Reality TV                 255
## 19 TV Show British TV Shows           253
## 20 TV Show Anime Series               176

Berdasarkan agregasi data diatas, maka genre international Movies menjadi genre yang paling banyak di Netflix dengan jumlah 2752 title, sedangkan genre TV shows menjadi genre yang paling sedikit muncul di Netflix dengan 16 title

Actor

Pada bagian ini, analis ingin mengetahui genre apa yang sering muncul di netflix, berikut langkah yang dilakukan adalah memisahkan data di kolom cast karena terdapat lebih dari satu actor pada satu kolom cast dan melakukan agregasi terhadap data

# Memisahkan data di kolom cast

netflix_cast <- strsplit(netflix3$cast, split = ", ")
cast_split <- data.frame(type = rep(netflix3$type, sapply(netflix_cast, length)), 
                               cast = unlist(netflix_cast))
cast_split$cast <- as.character(gsub(",","",cast_split$cast))

# menampilkan data teratas 
head(cast_split)
##      type             cast
## 1 TV Show       Ama Qamata
## 2 TV Show      Khosi Ngema
## 3 TV Show    Gail Mabalane
## 4 TV Show   Thabang Molaba
## 5 TV Show Dillon Windvogel
## 6 TV Show  Natasha Thahane

Setelah dipisahkan data cast, lalu dibuat data frame yang menampilkan tipe film / tv show dan cast, selanjutnya dilakukan agreasi untuk mendapat informasi actor yang sering tampil di platform netflix

actor_listed <- cast_split %>% 
  group_by(type,cast) %>% 
  summarise(count_actor = n()) %>% 
  arrange(desc(count_actor))
actor_listed
## # A tibble: 40,814 × 3
## # Groups:   type [2]
##    type  cast             count_actor
##    <fct> <chr>                  <int>
##  1 Movie Anupam Kher               42
##  2 Movie Shah Rukh Khan            35
##  3 Movie Naseeruddin Shah          32
##  4 Movie Akshay Kumar              30
##  5 Movie Om Puri                   30
##  6 Movie Amitabh Bachchan          28
##  7 Movie Julie Tejwani             28
##  8 Movie Paresh Rawal              28
##  9 Movie Boman Irani               27
## 10 Movie Rupa Bhimani              27
## # … with 40,804 more rows

Berdasarkan agregasi data diatas, maka Anupam Kher menjadi actor yang paling banyak muncul di Netflix dengan jumlah 42 title, sedangkan Nolan North menjadi actor yang paling sedikit muncul di Netflix dengan 6 title

Conclucion

1.Movie memiliki proporsi 70 % dibandingkan dengan TV Show dengan proporsi 30 %.

2.United States merupakan produsen Movie dan TV Show terbesar dengan 2752 title di Movie dan 938 title di TV Show.

3.Genre international movies merupakan genre yang paling banyak muncul di Netflix dengan 2752 title dan TV Show merupakan genre yang paling sedikit di Netflix dengan 16 title

4.Anupam Kher merupakan actoryang paling banyak muncul di Netflix dengan jumlah 42 title, sedangkan Nolan North menjadi actor yang paling sedikit muncul di Netflix dengan 6 title