library("ggtext")
library("tidyverse")
# fill colors
color_CE <- "#002590"
color_DB <- "#1A6450"
color_BO <- "#000000"
# outline colors
color_CE2 <- "#E40000"
color_DB2 <- "#CD9F1F"
color_BO2 <- "#FBE7A1"Characters
I have been binge watching the Detective Conan anime series (called Case Closed in USA). Fans like me use episode lists that are online, but with the popularity of the TV show, the websites sometimes crash. Then, I found out that there is a volunteer copy on Kaggle (made and uploaded by Fahad Hoadi).
Gadgets
Evidence
It is a deliminated data file, but not a comma-separated value setup. We instead use read_delim to be able to recognize that the separator is a semicolon.
DC_raw <- readr::read_delim("case_closed.csv", delim = ";")Clues
head(DC_raw)# A tibble: 6 × 4
Episode `Episode title` KAY Description
<dbl> <chr> <chr> <chr>
1 1 Roller Coaster Murder Case MAIN… Introducti…
2 2 Company President's Daughter Kidnapping Case (Remas… MAIN… Introducti…
3 3 An Idol's Locked Room Murder Case MANG… Character …
4 4 The Coded Map of the City Case MANG… First focu…
5 5 The Fated Blue Birthday (TV Special) MANG… Minor char…
6 6 Episode One: The Great Detective Turned Small (TV S… FILL… FILLER
Links
DC_eps <- DC_raw |>
janitor::clean_names() |>
filter(!is.na(episode)) |>
rename(type = kay) |>
mutate(type = stringr::str_to_title(type)) |>
mutate(season = (episode %/% 100) + 1) |>
mutate(season = factor(season))One Truth Always Prevails
string_title <- "<span style='color:#888888'>Detective Conan Has Had More</span>
<span style='color:#1A6450'><b>Filler Episodes</b></span>
<br>
<span style='color:#888888'>than</span>
<span style='color:#000000'><b>Main Plot</b></span>
<span style='color:#888888'>or</span>
<span style='color:#002590'><b>Manga Canon</b></span>
<span style='color:#888888'>Episodes Recently</span>"
string_subtitle <- "<span style='color:#1A6450'>(Seasons are in hundreds of episodes)</span>"
string_caption <- "<span style='color:#888888'>Source: Kaggle</span>"
string_x_label <- "<span style='color:#000000'>season</span>"
string_y_label <- "<span style='color:#002590'>proportion</span>"DC_eps |>
ggplot(aes(x = season, fill = type)) +
# ggplot(aes(x = season, color = type, fill = type)) +
geom_bar(stat = "count", position = "fill") +
labs(title = string_title,
subtitle = string_subtitle,
caption = string_caption,
x = string_x_label,
y = string_y_label) +
# scale_color_manual(values = c(color_DB2, color_BO2, color_CE2)) +
scale_fill_manual(values = c(color_DB, color_BO, color_CE)) +
theme_minimal() +
theme(axis.text.x = element_markdown(size = 16),
axis.text.y = element_blank(),
axis.ticks.x = element_blank(),
axis.ticks.y = element_blank(),
axis.title.x = element_markdown(size = 12),
axis.title.y = element_markdown(size = 10),
legend.position = "none",
plot.title = element_markdown(size = 18),
plot.subtitle = element_markdown(size = 14),
plot.caption = element_markdown(size = 10))
NoteSession Info
sessionInfo()R version 4.5.2 (2025-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)
Matrix products: default
LAPACK version 3.12.1
locale:
[1] LC_COLLATE=English_United States.utf8
[2] LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8
time zone: America/New_York
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lubridate_1.9.4 forcats_1.0.0 stringr_1.5.1 dplyr_1.1.4
[5] purrr_1.1.0 readr_2.1.5 tidyr_1.3.1 tibble_3.3.0
[9] ggplot2_4.0.0 tidyverse_2.0.0 ggtext_0.1.2
loaded via a namespace (and not attached):
[1] utf8_1.2.6 generics_0.1.4 xml2_1.3.8 stringi_1.8.7
[5] hms_1.1.3 digest_0.6.37 magrittr_2.0.3 evaluate_1.0.4
[9] grid_4.5.2 timechange_0.3.0 RColorBrewer_1.1-3 fastmap_1.2.0
[13] jsonlite_2.0.0 scales_1.4.0 cli_3.6.5 rlang_1.1.6
[17] crayon_1.5.3 litedown_0.7 commonmark_2.0.0 bit64_4.6.0-1
[21] withr_3.0.2 yaml_2.3.10 tools_4.5.2 parallel_4.5.2
[25] tzdb_0.5.0 vctrs_0.6.5 R6_2.6.1 lifecycle_1.0.4
[29] snakecase_0.11.1 htmlwidgets_1.6.4 bit_4.6.0 vroom_1.6.5
[33] janitor_2.2.1 pkgconfig_2.0.3 pillar_1.11.0 gtable_0.3.6
[37] glue_1.8.0 Rcpp_1.1.0 xfun_0.52 tidyselect_1.2.1
[41] rstudioapi_0.17.1 knitr_1.50 farver_2.1.2 htmltools_0.5.8.1
[45] labeling_0.4.3 rmarkdown_2.29 compiler_4.5.2 S7_0.2.0
[49] markdown_2.0 gridtext_0.1.5