Introduction
In this analysis, I used a data set that documents the movies and TV shows currently on Netflix. The data set describes the movie or show by length, genre, rating, release data, and country of origin and provides the descriptions and genres from Netflix. I used this data to determine the most common rating for the shows and movies released in 2021. Determining whether PG or R rated movies were most common, for example, indicates the age demographic that Netflix caters to the most.
Load necessary packages
library(tidyverse)
library(ggplot2)
library(knitr)
library(kableExtra)
library(dplyr)
Importing the Netflix dataset
netflix_titles <- read.csv("C:/Users/shayn/Downloads/R Scripts/netflix_titles.csv")
Data and Analysis
What was the most popular genre released in 2021?
Filtering the data for movies and shows released in 2021
netflix_titles_2021 <- filter(netflix_titles, release_year == 2021)
TV shows released in 2021 and filtered by rating
netflix_titles_2021_tv <- netflix_titles_2021 %>%
filter(rating == "PG" | rating == "PG-13" | rating == "R")
Movies released in 2021 and filtered by rating
netflix_titles_2021_movies <- netflix_titles_2021 %>%
filter(rating == "TV-G" | rating == "TV-14" | rating == "TV-PG" | rating == "TV-MA" |
rating == "TV-Y" | rating == "TV-Y7")
Counting the number of movies of each rating
netflix_titles_2021_movies_frequency <- netflix_titles_2021_movies %>%
count(rating)
Counting the number of movies of each rating
netflix_titles_2021_tv_frequency <- netflix_titles_2021_tv %>%
count(rating)
Results
Creating a bar chart of the different genres in 2021 for TV shows and movies
netflix_titles_2021_tv %>%
ggplot(aes(rating)) +
geom_bar(color = "black", fill = "black", width = 0.5) +
labs(x = "Genre",
y = "Number of Shows",
title = "Genre Distribution of Shows Released in 2021",
caption = "Figure 1. The number of shows added in 2021 grouped by rating") +
theme_classic() +
theme(plot.title = element_text(hjust = 0.5))

netflix_titles_2021_movies %>%
ggplot(aes(rating)) +
geom_bar(color = "black", fill = "black", width = 0.5) +
labs(x = "Genre",
y = "Number of Movies",
title = "Genre Distribution of Shows Released in 2021",
caption = "Figure 2. The number of movies added in 2021 grouped by rating") +
theme_classic() +
theme(plot.title = element_text(hjust = 0.5))

Creating tables of the number of movies and TV shows of each genre
knitr::kable(netflix_titles_2021_movies_frequency,
caption = "Table 1. Ratings of the movies released in 2021",
align = "cc",
col.names = c("Rating", "Number of movies")) %>%
kable_classic(full_width = F,
position = "center",
html_font = "Cambria")
Table 1. Ratings of the movies released in 2021
|
Rating
|
Number of movies
|
|
TV-14
|
151
|
|
TV-G
|
21
|
|
TV-MA
|
270
|
|
TV-PG
|
45
|
|
TV-Y
|
26
|
|
TV-Y7
|
33
|
knitr::kable(netflix_titles_2021_tv_frequency,
caption = "Table 2. Ratings of the TV shows released in 2021",
align = "cc",
col.names = c("Rating", "Number of TV shows")) %>%
kable_classic(full_width = F,
position = "center",
html_font = "Cambria")
Table 2. Ratings of the TV shows released in 2021
|
Rating
|
Number of TV shows
|
|
PG
|
11
|
|
PG-13
|
14
|
|
R
|
21
|
Conclusion
The most common rating for TV shows is TV-MA, and the second most common is TV-14 at about half as many listings as TV-MA. The amount of youth ratings is significantly. For movies, the most common rating is R, and the least common is PG. However, the difference between the ratings is less dramatic. Therefore, Netflix adds shows and movies mostly for teenagers and adults, so Netflix caters most to its older audience as opposed to children.