Dalam menampilkan hasil yang baik perlu dipersiapkan library yang mendukung pembuatan Data Visualization
library(dplyr) # untuk transformasi data
library(tidyr) # untuk cleansing data
library(ggplot2) # untuk visualisasi
library(ggpubr) # untuk export plot
library(scales) # untuk custom keterangan axis atau lainnya
library(glue) # untuk custom informasi saat plot interaktif
library(plotly) # untuk membuat plot menjadi interaktifDataset dalam format CSV, maka perlu dilakukan pembacaan (import) ke dalam R dan di olah, agar lebih mudah untuk di analisis.
- format awal = 'CSV'
- nama file = 'global_youtube_stat.csv'
- nama object = 'global_youtube_stat'
- fungsi di R
- membaca data/import = `read.csv()`
- menampilkan data = 'head()' atau 'tail()'
#> rank Youtuber subscribers video.views category Title
#> 1 1 T-Series 245000000 228000000000 Music T-Series
#> 2 2 YouTube Movies 170000000 0 Film & Animation youtubemovies
#> 3 3 MrBeast 166000000 28368841870 Entertainment MrBeast
#> uploads Country Abbreviation channel_type video_views_rank
#> 1 20082 India IN Music 1
#> 2 1 United States US Games 4055159
#> 3 741 United States US Entertainment 48
#> country_rank channel_type_rank video_views_for_the_last_30_days
#> 1 1 1 2258000000
#> 2 7670 7423 12
#> 3 1 1 1348000000
#> lowest_monthly_earnings highest_monthly_earnings lowest_yearly_earnings
#> 1 564600 9000000.00 6800000.00
#> 2 0 0.05 0.04
#> 3 337000 5400000.00 4000000.00
#> highest_yearly_earnings subscribers_for_last_30_days created_year
#> 1 108400000.00 2000000 2006
#> 2 0.58 NaN 2006
#> 3 64700000.00 8000000 2012
#> created_month created_date Gross.tertiary.education.enrollment.... Population
#> 1 Mar 13 28.1 1366417754
#> 2 Mar 5 88.2 328239523
#> 3 Feb 20 88.2 328239523
#> Unemployment.rate Urban_population Latitude Longitude
#> 1 5.36 471031528 20.59368 78.96288
#> 2 14.70 270663028 37.09024 -95.71289
#> 3 14.70 270663028 37.09024 -95.71289
- format awal = 'CSV'
- nama file = 'populasi_pddk.csv'
- nama object = 'populasi_pddk'
- fungsi di R
- membaca data/import = `read.csv()`
- menampilkan data = 'head()' atau 'tail()'
#> Country Inet_vs_pop
#> 1 Andorra 99
#> 2 Kuwait 98
#> 3 Sweden 96
Tahapan ini perlu dilakukan pengecekan tipe data agar pengolahan datanya lebih mudah, efektif dan cepat. Dalam R ada beberapa fungsi untuk melakukan cek tipe data.
Salah satu fungsi untuk mengecek tipe data, sebagai berikut:
- fungsi di R
- cek tipe data = `str()`
#> 'data.frame': 965 obs. of 28 variables:
#> $ rank : int 1 2 3 4 5 6 7 8 9 10 ...
#> $ Youtuber : chr "T-Series" "YouTube Movies" "MrBeast" "Cocomelon - Nursery Rhymes" ...
#> $ subscribers : int 245000000 170000000 166000000 162000000 159000000 119000000 112000000 111000000 106000000 98900000 ...
#> $ video.views : num 228000000000 0 28368841870 164000000000 148000000000 ...
#> $ category : chr "Music" "Film & Animation" "Entertainment" "Education" ...
#> $ Title : chr "T-Series" "youtubemovies" "MrBeast" "Cocomelon - Nursery Rhymes" ...
#> $ uploads : int 20082 1 741 966 116536 0 1111 4716 493 574 ...
#> $ Country : chr "India" "United States" "United States" "United States" ...
#> $ Abbreviation : chr "IN" "US" "US" "US" ...
#> $ channel_type : chr "Music" "Games" "Entertainment" "Education" ...
#> $ video_views_rank : int 1 4055159 48 2 3 4057944 5 44 630 8 ...
#> $ country_rank : num 1 7670 1 2 2 NaN 3 1 5 5 ...
#> $ channel_type_rank : num 1 7423 1 1 2 ...
#> $ video_views_for_the_last_30_days : num 2258000000 12 1348000000 1975000000 1824000000 ...
#> $ lowest_monthly_earnings : num 564600 0 337000 493800 455900 ...
#> $ highest_monthly_earnings : num 9000000 0.05 5400000 7900000 7300000 ...
#> $ lowest_yearly_earnings : num 6800000 0.04 4000000 5900000 5500000 ...
#> $ highest_yearly_earnings : num 108400000 0.58 64700000 94800000 87500000 ...
#> $ subscribers_for_last_30_days : num 2000000 NaN 8000000 1000000 1000000 NaN NaN NaN 100000 600000 ...
#> $ created_year : num 2006 2006 2012 2006 2006 ...
#> $ created_month : chr "Mar" "Mar" "Feb" "Sep" ...
#> $ created_date : num 13 5 20 1 20 24 12 29 14 23 ...
#> $ Gross.tertiary.education.enrollment....: num 28.1 88.2 88.2 88.2 28.1 NaN 88.2 63.2 81.9 88.2 ...
#> $ Population : num 1366417754 328239523 328239523 328239523 1366417754 ...
#> $ Unemployment.rate : num 5.36 14.7 14.7 14.7 5.36 NaN 14.7 2.29 4.59 14.7 ...
#> $ Urban_population : num 471031528 270663028 270663028 270663028 471031528 ...
#> $ Latitude : num 20.6 37.1 37.1 37.1 20.6 ...
#> $ Longitude : num 79 -95.7 -95.7 -95.7 79 ...
Terdapat fungsi lain untuk mengecek tipe data, namun perlu menginstal library, seperti dibawah ini:
- library = 'dplyr'
- fungsi di R
- cek tipe data = `glimpse()`
#> Rows: 965
#> Columns: 28
#> $ rank <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,…
#> $ Youtuber <chr> "T-Series", "YouTube Movies", …
#> $ subscribers <int> 245000000, 170000000, 16600000…
#> $ video.views <dbl> 228000000000, 0, 28368841870, …
#> $ category <chr> "Music", "Film & Animation", "…
#> $ Title <chr> "T-Series", "youtubemovies", "…
#> $ uploads <int> 20082, 1, 741, 966, 116536, 0,…
#> $ Country <chr> "India", "United States", "Uni…
#> $ Abbreviation <chr> "IN", "US", "US", "US", "IN", …
#> $ channel_type <chr> "Music", "Games", "Entertainme…
#> $ video_views_rank <int> 1, 4055159, 48, 2, 3, 4057944,…
#> $ country_rank <dbl> 1, 7670, 1, 2, 2, NaN, 3, 1, 5…
#> $ channel_type_rank <dbl> 1, 7423, 1, 1, 2, NaN, 3, 4, 2…
#> $ video_views_for_the_last_30_days <dbl> 2258000000, 12, 1348000000, 19…
#> $ lowest_monthly_earnings <dbl> 564600, 0, 337000, 493800, 455…
#> $ highest_monthly_earnings <dbl> 9000000.00, 0.05, 5400000.00, …
#> $ lowest_yearly_earnings <dbl> 6800000.00, 0.04, 4000000.00, …
#> $ highest_yearly_earnings <dbl> 108400000.00, 0.58, 64700000.0…
#> $ subscribers_for_last_30_days <dbl> 2000000, NaN, 8000000, 1000000…
#> $ created_year <dbl> 2006, 2006, 2012, 2006, 2006, …
#> $ created_month <chr> "Mar", "Mar", "Feb", "Sep", "S…
#> $ created_date <dbl> 13, 5, 20, 1, 20, 24, 12, 29, …
#> $ Gross.tertiary.education.enrollment.... <dbl> 28.1, 88.2, 88.2, 88.2, 28.1, …
#> $ Population <dbl> 1366417754, 328239523, 3282395…
#> $ Unemployment.rate <dbl> 5.36, 14.70, 14.70, 14.70, 5.3…
#> $ Urban_population <dbl> 471031528, 270663028, 27066302…
#> $ Latitude <dbl> 20.59368, 37.09024, 37.09024, …
#> $ Longitude <dbl> 78.962880, -95.712891, -95.712…
Setelah dilakukan pengecekan tipe data, kolom/field yang perlu diubah tipe datanya ke dalam FACTOR yaitu:
category, Country, channel_type, –> semula CHR diubah menjadi FACTOR
Untuk merubah data dari CHR ke FACTOR menggunakan fungsi sebagai berikut:
- fungsi di R
- ubah tipe data FACTOR = `as.factor()`
Setelah dilakukan perubahan tipe data, maka perlu dicek kembali tipe datanya, apakah sudah sesuai yang diharapkan
#> 'data.frame': 841 obs. of 28 variables:
#> $ rank : int 1 2 3 4 5 7 8 9 10 11 ...
#> $ Youtuber : chr "T-Series" "YouTube Movies" "MrBeast" "Cocomelon - Nursery Rhymes" ...
#> $ subscribers : int 245000000 170000000 166000000 162000000 159000000 112000000 111000000 106000000 98900000 96700000 ...
#> $ video.views : num 228000000000 0 28368841870 164000000000 148000000000 ...
#> $ category : Factor w/ 19 levels "Autos & Vehicles",..: 9 5 4 3 16 13 6 13 4 9 ...
#> $ Title : chr "T-Series" "youtubemovies" "MrBeast" "Cocomelon - Nursery Rhymes" ...
#> $ uploads : int 20082 1 741 966 116536 1111 4716 493 574 8548 ...
#> $ Country : Factor w/ 49 levels "Afghanistan",..: 18 47 47 47 18 47 22 34 47 18 ...
#> $ Abbreviation : chr "IN" "US" "US" "US" ...
#> $ channel_type : Factor w/ 15 levels "Animals","Autos",..: 9 7 5 4 5 5 5 13 5 9 ...
#> $ video_views_rank : int 1 4055159 48 2 3 5 44 630 8 12 ...
#> $ country_rank : num 1 7670 1 2 2 3 1 5 5 3 ...
#> $ channel_type_rank : num 1 7423 1 1 2 ...
#> $ video_views_for_the_last_30_days : num 2258000000 12 1348000000 1975000000 1824000000 ...
#> $ lowest_monthly_earnings : num 564600 0 337000 493800 455900 ...
#> $ highest_monthly_earnings : num 9000000 0.05 5400000 7900000 7300000 ...
#> $ lowest_yearly_earnings : num 6800000 0.04 4000000 5900000 5500000 ...
#> $ highest_yearly_earnings : num 108400000 0.58 64700000 94800000 87500000 ...
#> $ subscribers_for_last_30_days : num 2000000 NaN 8000000 1000000 1000000 NaN NaN 100000 600000 1100000 ...
#> $ created_year : num 2006 2006 2012 2006 2006 ...
#> $ created_month : chr "Mar" "Mar" "Feb" "Sep" ...
#> $ created_date : num 13 5 20 1 20 12 29 14 23 12 ...
#> $ Gross.tertiary.education.enrollment....: num 28.1 88.2 88.2 88.2 28.1 88.2 63.2 81.9 88.2 28.1 ...
#> $ Population : num 1366417754 328239523 328239523 328239523 1366417754 ...
#> $ Unemployment.rate : num 5.36 14.7 14.7 14.7 5.36 14.7 2.29 4.59 14.7 5.36 ...
#> $ Urban_population : num 471031528 270663028 270663028 270663028 471031528 ...
#> $ Latitude : num 20.6 37.1 37.1 37.1 20.6 ...
#> $ Longitude : num 79 -95.7 -95.7 -95.7 79 ...
Untuk memastikan hasil pengolahan data sesuai yang diharapkan, maka perlu dilakukan penggabungan 2 tabel
#> Country rank Youtuber subscribers video.views category
#> 1 Afghanistan 378 Linkin Park 20400000 13397000296 Music
#> 2 Andorra 664 Musas 15100000 2400037562 Howto & Style
#> 3 Argentina 528 El Reino a Jugar 17200000 11445492404 Education
#> 4 Argentina 673 Rub������ 15100000 9477021288 Comedy
#> 5 Argentina 106 La Granja de Zen� 35700000 27118354077 Music
#> Title uploads Abbreviation channel_type video_views_rank
#> 1 linkinpark 0 AF Games 4057944
#> 2 Jordi Sala 159 AD People 3889418
#> 3 El Reino a Jugar 1007 AR Education 353
#> 4 Rub������ 921 AR Comedy 491
#> 5 La Granja de Zen� 654 AR Music 58
#> country_rank channel_type_rank video_views_for_the_last_30_days
#> 1 1385 7136 NaN
#> 2 504 7615 86
#> 3 11 28 83709000
#> 4 13 28 512343000
#> 5 2 37 302071000
#> lowest_monthly_earnings highest_monthly_earnings lowest_yearly_earnings
#> 1 0.00 0.00 0.00
#> 2 0.02 0.34 0.26
#> 3 20900.00 334800.00 251100.00
#> 4 128100.00 2000000.00 1500000.00
#> 5 75500.00 1200000.00 906200.00
#> highest_yearly_earnings subscribers_for_last_30_days created_year
#> 1 0 12 2006
#> 2 4 NaN 2006
#> 3 4000000 100000 2015
#> 4 24600000 700000 2016
#> 5 14500000 400000 2013
#> created_month created_date Gross.tertiary.education.enrollment.... Population
#> 1 Nov 28 9.7 38041754
#> 2 Mar 12 NaN NaN
#> 3 Mar 3 90.0 44938712
#> 4 Aug 2 90.0 44938712
#> 5 Jun 6 90.0 44938712
#> Unemployment.rate Urban_population Latitude Longitude Inet_vs_pop
#> 1 11.12 9797273 33.93911 67.70995 11
#> 2 NaN NaN NaN NaN 99
#> 3 9.79 41339571 -38.41610 -63.61667 76
#> 4 9.79 41339571 -38.41610 -63.61667 76
#> 5 9.79 41339571 -38.41610 -63.61667 76
Proses eksplorasi data untuk mengidentifikasi pola, anomali, hipotesis, hubungan, dan informasi yang tersembunyi di dalam data.
Dalam menganalisis data, data exploration sangat penting karena dapat memberikan gambaran awal tentang data dan membantu dalam menentukan pendekatan analisis data yang tepat.
- fungsi di R
- statistik sederhan = `summary()`
#> Country rank Youtuber subscribers
#> United States :305 Min. : 1.0 Length:841 Min. : 12300000
#> India :168 1st Qu.:257.0 Class :character 1st Qu.: 14500000
#> Brazil : 61 Median :505.0 Mode :character Median : 17700000
#> United Kingdom: 43 Mean :501.9 Mean : 23012842
#> Mexico : 33 3rd Qu.:748.0 3rd Qu.: 24100000
#> Indonesia : 28 Max. :995.0 Max. :245000000
#> (Other) :203
#> video.views category Title
#> Min. : 0 Entertainment :205 Length:841
#> 1st Qu.: 4301581610 Music :179 Class :character
#> Median : 7762905663 People & Blogs: 97 Mode :character
#> Mean : 11337542232 Gaming : 77
#> 3rd Qu.: 13626331061 Comedy : 67
#> Max. :228000000000 Education : 41
#> (Other) :175
#> uploads Abbreviation channel_type video_views_rank
#> Min. : 0 Length:841 Entertainment:276 Min. : 1
#> 1st Qu.: 289 Class :character Music :193 1st Qu.: 285
#> Median : 876 Mode :character Games : 81 Median : 802
#> Mean : 10569 People : 67 Mean : 270594
#> 3rd Qu.: 3315 Comedy : 48 3rd Qu.: 2297
#> Max. :301308 Education : 46 Max. :4057944
#> (Other) :130
#> country_rank channel_type_rank video_views_for_the_last_30_days
#> Min. : 1.0 Min. : 1.0 Min. : 1
#> 1st Qu.: 13.0 1st Qu.: 25.0 1st Qu.: 25671500
#> Median : 54.0 Median : 62.0 Median : 71870000
#> Mean : 378.2 Mean : 439.2 Mean : 181666780
#> 3rd Qu.: 123.0 3rd Qu.: 132.0 3rd Qu.: 177114500
#> Max. :7741.0 Max. :7670.0 Max. :6589000000
#> NA's :7 NA's :18
#> lowest_monthly_earnings highest_monthly_earnings lowest_yearly_earnings
#> Min. : 0 Min. : 0 Min. : 0
#> 1st Qu.: 4800 1st Qu.: 76100 1st Qu.: 57100
#> Median : 15800 Median : 253200 Median : 189900
#> Mean : 39069 Mean : 624671 Mean : 468487
#> 3rd Qu.: 42000 3rd Qu.: 671600 3rd Qu.: 503700
#> Max. :576000 Max. :9200000 Max. :6900000
#>
#> highest_yearly_earnings subscribers_for_last_30_days created_year
#> Min. : 0 Min. : 1 Min. :2005
#> 1st Qu.: 913400 1st Qu.: 100000 1st Qu.:2009
#> Median : 3000000 Median : 200000 Median :2013
#> Mean : 7501232 Mean : 352868 Mean :2012
#> 3rd Qu.: 8100000 3rd Qu.: 400000 3rd Qu.:2016
#> Max. :110600000 Max. :8000000 Max. :2022
#> NA's :268
#> created_month created_date Gross.tertiary.education.enrollment....
#> Length:841 Min. : 1.00 Min. : 7.60
#> Class :character 1st Qu.: 8.00 1st Qu.: 36.30
#> Mode :character Median :15.00 Median : 66.30
#> Mean :15.55 Mean : 63.19
#> 3rd Qu.:23.00 3rd Qu.: 88.20
#> Max. :31.00 Max. :113.10
#> NA's :1
#> Population Unemployment.rate Urban_population Latitude
#> Min. : 202506 Min. : 0.750 Min. : 35588 Min. :-38.42
#> 1st Qu.: 106184480 1st Qu.: 5.360 1st Qu.: 55908316 1st Qu.: 20.59
#> Median : 328239523 Median : 9.710 Median :270663028 Median : 37.09
#> Mean : 439978728 Mean : 9.314 Mean :227694351 Mean : 26.31
#> 3rd Qu.: 328239523 3rd Qu.:14.700 3rd Qu.:270663028 3rd Qu.: 37.09
#> Max. :1366417754 Max. :14.720 Max. :471031528 Max. : 61.92
#> NA's :1 NA's :1 NA's :1 NA's :1
#> Longitude Inet_vs_pop
#> Min. :-172.10 Min. :11.00
#> 1st Qu.: -95.71 1st Qu.:60.00
#> Median : -51.93 Median :85.00
#> Mean : -15.76 Mean :77.67
#> 3rd Qu.: 78.96 3rd Qu.:94.00
#> Max. : 138.25 Max. :99.00
#> NA's :1 NA's :1
Berdasarkan eksplorasi data menggunakan fungsi ‘summary()’ dapat ditampilkan analisa sedarhana sebagai berikut:
Statistik yang dihasilkan dari PT. XYZ
Grafik Youtuber terpopuler berdasarkan negara
Kode ini untuk menghitung jumlah youtuber tertinggi di setiap negara
# plot 1 ---------------------------------------------------------------
gab_count <- gab %>%
group_by(Country) %>%
summarise(count = n()) %>%
ungroup() %>%
arrange(-count) %>%
top_n(10)Kode ini untuk membuat label pada tooltip di dalam grafik
# membuat label
gab_count <- gab_count %>%
mutate(
label = glue("Negara= {Country}
Jumlah Youtuber = {count}"))Kode ini untuk membuat plot statis dan interaktif
# Visualisasi plot statis
plot1 <- ggplot(data = gab_count, aes(x = count, #horizontal barplot
y = reorder(Country, count),
text = label)) +
geom_col(aes(fill = count)) +
scale_fill_gradient(low = "aquamarine", high = "darkgreen") +
labs(title = "<span style = 'font-size:9pt'>Jumlah Youtuber Populer vs Negara </span>",
x = "Jumlah Youtuber",
y = NULL) +
theme_minimal() +
theme(legend.position = "none")
# Visualisasi plot interaktif
ggplotly(plot1, tooltip = "text")Grafik asal Negara Youtuber dibandingkan Jumlah Penduduk
Kode ini untuk menghitung jumlah penduduk di setiap negara dengan kondisi jumlah youtuber tertinggi di dunia
# plot 2 ---------------------------------------------------------------
gab_count2 <- gab %>%
group_by(Country, Population) %>%
summarise(count2 = n()) %>%
ungroup() %>%
arrange(-count2) %>%
top_n(10)Kode ini untuk membuat label pada tooltip di dalam grafik
gab_count2 <- gab_count2 %>%
mutate(
label2a = glue("Negara= {Country}
Populasi = {Population}
Jumlah Trending = {count2}"))Kode ini untuk membuat plot statis dan interaktif
# Visualisasi plot statis
plot2 <- ggplot(data = gab_count2, aes(x = Population, #horizontal barplot
y = reorder(Country, count2),
text = label2a)) +
geom_col(aes(fill = Population)) +
scale_fill_gradient(low = "aquamarine", high = "darkgreen") +
scale_x_continuous(labels = comma) +
labs(title = "<span style = 'font-size:9pt'>Negara Youtuber vs Jumlah Penduduk</span> ",
x = "Jumlah Penduduk",
y = NULL) +
theme_minimal() +
theme(legend.position = "none")
# Visualisasi plot interaktif
ggplotly(plot2, tooltip = "text")Grafik Rasio Pengguna Internet pada setiap negara
Kode ini untuk menampilkan Rasio Pengguna Internet di setiap negara dengan kondisi jumlah youtuber tertinggi di dunia
# plot 3 ---------------------------------------------------------------
gab_count3 <- gab %>%
group_by(Country, Inet_vs_pop) %>%
summarise(count3 = n()) %>%
ungroup() %>%
arrange(-count3) %>%
top_n(10)Kode ini untuk membuat label pada tooltip di dalam grafik
gab_count3 <- gab_count3 %>%
mutate(
label3 = glue("Negara= {Country}
Internet VS Populasi = {Inet_vs_pop}
Jumlah Trending = {count3}"))Kode ini untuk membuat plot statis dan interaktif
# Visualisasi plot statis
plot3 <- ggplot(data = gab_count3, aes(x = Inet_vs_pop, #horizontal barplot
y = reorder(Country, count3),
text = label3)) +
geom_col(aes(fill = Inet_vs_pop)) +
scale_fill_gradient(low = "aquamarine", high = "darkgreen") +
labs(title = "<span style = 'font-size:9pt'>Negara Youtuber vs Rasio pengguna internet</span> ",
x = "Rasio Pengguna Internet",
y = NULL) +
theme_minimal() +
theme(legend.position = "none")
# Visualisasi plot interaktif
ggplotly(plot3, tooltip = "text")Grafik tahun pembuatan video yang populer
Kode ini untuk menampilkan jumlah viewer berdasarkan tahun pembuatan video
# plot 4 ---------------------------------------------------------------
gab_count4 <- gab %>%
group_by(created_year) %>%
#summarise(count3 = n()) %>%
summarise(tot_views = sum(video.views)) %>%
ungroup() %>%
mutate(
label4 = glue("Tahun dipublikasikan = {created_year}
Jumlah viewer = {comma(tot_views, accuracy = 0.01)}
"))Kode ini untuk membuat plot statis dan interaktif
# Visualisasi plot statis
plot4 <- ggplot(gab_count4,
aes(x = created_year,
y = tot_views))+
geom_line(col = "aquamarine") +
geom_point(aes(text = label4), col="darkgreen") +
scale_y_continuous(labels = comma) +
labs(
title = "Jumlah viewer berdasarkan tahun pembuatan video",
x = "Tahun ",
y = "Jumlah viewer"
) +
theme_minimal() +
theme(plot.title = element_text(hjust = 0.5))
# Visualisasi plot interaktif
ggplotly(plot4, tooltip = "text")Grafik penghasilan youtuber di Indonesia
Kode ini untuk menampilkan jumlah viewer berdasarkan tahun pembuatan video
# plot 5 ---------------------------------------------------------------
gab_count5 <- gab %>%
filter(Country == "Indonesia") %>%
group_by(Youtuber) %>%
summarise(total_earn = (highest_yearly_earnings)) %>%
ungroup() %>%
arrange(-total_earn) %>%
head(15)
gab_count5 <- gab_count5 %>%
mutate(
label5 = glue("Nama Youtuber = {Youtuber}
Total pendapatan tahunan = USD {comma(total_earn)}
")
)
# Visualisasi plot statis
plot5 <- ggplot(gab_count5,
aes(x = total_earn,
y = reorder(Youtuber,total_earn),
text = label5,
color = total_earn)) +
geom_point(size = 3) +
geom_segment(aes(x = 0,
xend = total_earn,
y = Youtuber,
yend = Youtuber),
size = 1.5) +
scale_color_gradient(low = "aquamarine",
high = "darkgreen") +
scale_x_continuous(labels = comma) +
labs(title = glue("<span style = 'font-size:10pt'> Pendapatan Youtuber di Indonesia</span>"),
x = "Total Pendapatan per-Tahun (USD)",
y = NULL) +
theme_minimal() +
theme(legend.position = "none",
plot.title = element_text(hjust = 0.5))
# Visualisasi plot interaktif
ggplotly(plot5,tooltip = "text") 10 Negara tertinggi dengan Jumlah Youtuber Populer, yaitu: USA, India, Brazil, Inggris, Mexico, Indonesia, Spanyol, Thailand, Korea Selatan, Rusia
Indonesia Urutan Ke 6 dengan jumlah Youtuber Populer di Dunia dan jumlah penduduk sedikit dibawah USA
Dengan Jumlah penduduk Indonesia yang besar dan Rasio pengguna internet yang tinggi, Indonesia mempunyai peluang untuk mencetak “Youtuber Baru” yang bisa populer dan menghasilkan “cuan”
Semakin lama dipublikasikan, maka semakin banyak viewernya, dengan syarat apabila memiliki konten yang tidak “basi”
Jumlah penghasilan tertinggi youtuber populer di Indonesia seperti Ria Ricis sebesar USD 7.500.000 atau lebih dari Rp. 100 M per-tahun, berikut juga dengan Jess No Limit yang paling populer sebesar USD 26.300.000 atau sekitar Rp. 390 M per-tahun