Animal Crossing Data Visualization & Structural Topic Modeling

This blog post analyzes the game Animal Crossing datasets from TidyTuesday. I do not play games, but this analysis would give me some opportunity to understand what this game is. Also, this is my first time using the stm package, which is an R package helping build up structural topic modeling. Read more

Broadway Weekly Grosses Data Visualization with tidymetrics

In this blog post, I will be analyzing datasets about Broadway gross revenue datasets from TidyTuesday. Also, this blog post is my first time using the package tidymetrics to explore one of the datasets. Load the related packages! library(tidyverse) library(lubridate) library(tidytext) library(tidymetrics) library(scales) theme_set(theme_bw()) grosses <- read_csv('https://raw. Read more

GDPR Data Visualization

This blog post analyzes the E.U.’s General Data Protection Regulation (GDPR) from TidyTuesday. library(tidyverse) library(tidytext) library(lubridate) library(scales) theme_set(theme_bw()) gdpr <- read_tsv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-04-21/gdpr_text.tsv") gdpr_violations <- read_tsv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-04-21/gdpr_violations.tsv") %>% mutate(article_violated = str_remove_all(article_violated, "\\s*"), date = mdy(date)) gdpr ## # A tibble: 425 x 7 ## chapter chapter_title article article_title sub_article gdpr_text href ## <dbl> <chr> <dbl> <chr> <dbl> <chr> <chr> ## 1 1 General provi~ 1 Subject-matte~ 1 "This Regul~ http:~ ## 2 1 General provi~ 1 Subject-matte~ 2 "This Regul~ http:~ ## 3 1 General provi~ 1 Subject-matte~ 3 "The free m~ http:~ ## 4 1 General provi~ 2 Material scope 1 "This Regul~ http:~ ## 5 1 General provi~ 2 Material scope 2 "This Regul~ http:~ ## 6 1 General provi~ 2 Material scope 3 "For the pr~ http:~ ## 7 1 General provi~ 2 Material scope 4 "This Regul~ http:~ ## 8 1 General provi~ 3 Territorial s~ 1 "This Regul~ http:~ ## 9 1 General provi~ 3 Territorial s~ 2 "This Regul~ http:~ ## 10 1 General provi~ 3 Territorial s~ 3 "the monito~ http:~ ## # . Read more

Tour de France Data Visualization & Survival Analysis

This blog post analyzes datasets about Tour de France, which is the annual historical biking event held in France for more than 100 years. The datasets are from TidyTuesday. library(tidyverse) library(lubridate) library(survival) theme_set(theme_bw()) stage_data <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-04-07/stage_data.csv") %>% mutate(decade = 10 * floor(year/10)) tdf_stages <- read_csv("https://raw. Read more

U.S. Beer Consumption & Tax Data Visualization

In this blog post, I will analyze four beer related datasets from TidyTuesday. library(tidyverse) library(lubridate) library(geofacet) theme_set(theme_bw()) Processing datasets! brewing_materials <- read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-03-31/brewing_materials.csv') %>% select(-c(contains("ytd"), data_type)) %>% mutate(type = str_remove(type, " \\(.+\\)")) %>% group_by(year, month, material_type, type) %>% mutate(month_current = sum(month_current), month_prior_year = sum(month_prior_year)) %>% distinct() %>% ungroup() %>% mutate(date = make_date(year, month), type = str_remove(type, " and . Read more

The Office Rating Data Visualization & Lasso Models

This blog post analyzes the TV Show The Office. This dataset comes from TidyTuesday, the data science online community. library(tidyverse) library(schrute) library(lubridate) library(tidytext) library(Matrix) library(glmnet) library(broom) theme_set(theme_bw()) office <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-03-17/office_ratings.csv") office ## # A tibble: 188 x 6 ## season episode title imdb_rating total_votes air_date ## <dbl> <dbl> <chr> <dbl> <dbl> <date> ## 1 1 1 Pilot 7. Read more

CRAN Package Data Analysis & Visualization

CRAN is the official repository for R packages. Because of so many wonderful packages, such as Tidyverse, our everyday data science work has turned out to be so much easier and more convenient. While using various R packages, we can see the collective efforts made by the R community. Read more

NYC Squirrels Data Visualization

This blog post analyzes the dataset about squirrels in NYC. Here is the link of the dataset. library(tidyverse) library(tidytext) library(lubridate) theme_set(theme_bw()) nyc_squirrels <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-10-29/nyc_squirrels.csv") %>% mutate(date = mdy(date)) nyc_squirrels ## # A tibble: 3,023 x 36 ## long lat unique_squirrel_~ hectare shift date hectare_squirre~ age ## <dbl> <dbl> <chr> <chr> <chr> <date> <dbl> <chr> ## 1 -74. Read more

Car Visualization & Natual Spline Fitting

mtcars is a classical dataset that is used to illustrate how to use ggplot2 in some good visualization reference. Here in this blog post, I will analyze a much larger version of mtcars dataset from TidyTuesday. library(tidyverse) library(tidytext) library(splines) library(broom) library(scales) car_economy <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-10-15/big_epa_cars.csv") %>% rename(city_mpg = "city08", highway_mpg = "highway08", fuel_type = "fuelType", combined_mpg = "comb08", model_year = "year") %>% mutate(fuel_type = fct_recode(fuel_type, Hybrid = "Regular Gas and Electricity")) car_economy ## # A tibble: 41,804 x 83 ## barrels08 barrelsA08 charge120 charge240 city_mpg city08U cityA08 cityA08U ## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 15. Read more

Pizza Restaurant Data Visualization

This blog post analyzes a number of datasets related to Pizza, and they are from TidyTuesday Data Science Project. library(tidyverse) library(scales) library(tidytext) library(broom) Using as.POSIXct() to transfrom non-sense time object into actual date. pizza_jared <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-10-01/pizza_jared.csv") %>% filter(answer != "Fair") %>% mutate(answer = factor(answer, levels = c("Never Again", "Poor", "Average", "Good", "Excellent")), time = as. Read more