Inspect and Plot TidyTuesday Data
inspect_plot.Rd
A comprehensive function that analyzes TidyTuesday datasets and generates appropriate inspection plots based on data characteristics and number of datasets.
Arguments
- ttd
A list of data frames from
load_tt_data()
- plot
Character vector specifying which plots to generate. Options include:
"types"
- Column type distributions"mem"
- Memory usage analysis"na"
- Missing value analysis"cor"
- Correlation analysis (numeric columns)"imb"
- Feature imbalance (categorical columns)"num"
- Numeric column summaries"cat"
- Categorical column summaries"all"
- Generate all available plots (default)
Examples
ttd <- load_tt_data("Moore’s Law")
#> INFO [2025-07-24 06:20:05] Starting import for cpu.csv from https://raw.githubusercontent.com/rfordatascience/tidytuesday/refs/heads/main/data/2019/2019-09-03/cpu.csv
#> SUCCESS [2025-07-24 06:20:05] Successfully loaded cpu.csv
#> INFO [2025-07-24 06:20:05] Starting import for gpu.csv from https://raw.githubusercontent.com/rfordatascience/tidytuesday/refs/heads/main/data/2019/2019-09-03/gpu.csv
#> SUCCESS [2025-07-24 06:20:05] Successfully loaded gpu.csv
#> INFO [2025-07-24 06:20:05] Starting import for ram.csv from https://raw.githubusercontent.com/rfordatascience/tidytuesday/refs/heads/main/data/2019/2019-09-03/ram.csv
#> SUCCESS [2025-07-24 06:20:06] Successfully loaded ram.csv
# Generate all plots
inspect_plot(ttd)
#> INFO [2025-07-24 06:20:06] inspect_plot(): starting analysis
#> INFO [2025-07-24 06:20:06] Beginning plot type 'types'
#> SUCCESS [2025-07-24 06:20:06] Completed plot type 'types'
#> INFO [2025-07-24 06:20:06] Beginning plot type 'mem'
#> SUCCESS [2025-07-24 06:20:07] Completed plot type 'mem'
#> INFO [2025-07-24 06:20:07] Beginning plot type 'na'
#> SUCCESS [2025-07-24 06:20:07] Completed plot type 'na'
#> INFO [2025-07-24 06:20:07] Beginning plot type 'cor'
#> SUCCESS [2025-07-24 06:20:08] Completed plot type 'cor'
#> INFO [2025-07-24 06:20:08] Beginning plot type 'imb'
#> SUCCESS [2025-07-24 06:20:08] Completed plot type 'imb'
#> INFO [2025-07-24 06:20:08] Beginning plot type 'num'
#> SUCCESS [2025-07-24 06:20:09] Completed plot type 'num'
#> INFO [2025-07-24 06:20:09] Beginning plot type 'cat'
#> SUCCESS [2025-07-24 06:20:10] Completed plot type 'cat'
#> SUCCESS [2025-07-24 06:20:10] inspect_plot(): all requested plots finished
#> NULL
# Generate only specific plots
inspect_plot(ttd, plot = c("types", "mem"))
#> INFO [2025-07-24 06:20:10] inspect_plot(): starting analysis
#> INFO [2025-07-24 06:20:10] Beginning plot type 'types'
#> SUCCESS [2025-07-24 06:20:10] Completed plot type 'types'
#> INFO [2025-07-24 06:20:10] Beginning plot type 'mem'
#> SUCCESS [2025-07-24 06:20:10] Completed plot type 'mem'
#> SUCCESS [2025-07-24 06:20:10] inspect_plot(): all requested plots finished
#> NULL
# Generate single plot type
inspect_plot(ttd, plot = "cor")
#> INFO [2025-07-24 06:20:10] inspect_plot(): starting analysis
#> INFO [2025-07-24 06:20:10] Beginning plot type 'cor'
#> SUCCESS [2025-07-24 06:20:11] Completed plot type 'cor'
#> SUCCESS [2025-07-24 06:20:11] inspect_plot(): all requested plots finished
#> NULL