knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
Background

Sherlock Holmes series is taken out from Netflix USA, but still appears in Netflix from Indonesia. Because of this, I became curious on how many TV series/movies are on Netflix for different countries. In addition, I also realize that prices are different, depending on where you are.

Source: https://www.kaggle.com/prasertk/netflix-subscription-price-in-different-countries

df3 <- FunctionPkg::df3
library(dplyr)
fig <- plotly::plot_ly(df3, type='choropleth', locations=df3$Code, z=df3$Cost_basic, text=df3$Country, colorscale="Blues")

# light grey boundaries
l <- list(color = "grey", width = 0.5)


fig <- fig %>% plotly::colorbar(title = 'Cost (US$)', tickprefix = '$')
# fig <- fig %>% graphics::layout(
#     title = 'Netflix Monthly Basic Subscription<br>'
#   )
#Source: <a href="https://www.kaggle.com/prasertk/netflix-subscription-price-in# -different-countries">Kaggle</a>'
fig
# scatter plot comparing price and library size
# fig2 <- plotly::plot_ly(data = df3, x = ~Cost_basic, y = ~Total.Library.Size,
#                # Hover text:
#                text = ~paste("Price: $", Cost_basic, '<br>Library Size:', Total.Library.Size, "<br>Country:", Country),
#                marker = list(size = 10,
#                              color = 'rgba(255, 182, 193, .9)',
#                              line = list(color = 'rgba(152, 0, 0, .8)',
#                                          width = 2)))
# 
# fig2 <- fig2 %>% plotly::layout(title = 'Total Library Size vs Cost',
#          yaxis = list(zeroline = FALSE, title = 'Total Library Size (Movie + TV Show)'),
#          xaxis = list(zeroline = FALSE, title = 'Monthly Subscription Cost $'))
# 
# fig2
# ```r
# bar_fig <- plotly::plot_ly(
#   data = df3,
#   y = ~Cost_per_title_basic,
#   x = ~Country,
#   type = 'bar'
# ) %>% 
#   plotly::layout(title = "Cost per title for the Basic Plan",
#                  xaxis = list(categoryorder = "total descending"),
#                  yaxis = list(title = 'Cost in USD'), barmode = 'group'
#   )
# bar_fig
# ```


haoping-he/FunctionPkg documentation built on April 14, 2022, 10:46 a.m.