Final Report (Tidy Tuesday)

Author

Shifa Maqsood

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.0     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ ggplot2   3.4.1     ✔ tibble    3.1.8
✔ lubridate 1.9.2     ✔ tidyr     1.3.0
✔ purrr     1.0.1     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the ]8;;http://conflicted.r-lib.org/conflicted package]8;; to force all conflicts to become errors
library(treemap)

#ArtHistorytidytuesday

tuesdata <- tidytuesdayR::tt_load('2023-01-17')
--- Compiling #TidyTuesday Information for 2023-01-17 ----
--- There is 1 file available ---
--- Starting Download ---

    Downloading file 1 of 1: `artists.csv`
--- Download complete ---
arthistory <-tuesdata[["artists"]]

count_of_artists <- arthistory %>%
  group_by(year) %>%
  count()

count_of_artistsggplot <- ggplot(count_of_artists, aes(x= year, y=n)) +
  geom_bar(stat="identity",position="dodge", fill="darkgreen") +
  scale_x_continuous(breaks = seq(1925,2025,25))+
  scale_y_continuous(breaks =seq(0,200, 50))+
  ggtitle("Overall Count of Artists in Gardener's Art Throughout the Ages")+
  ylab("Count")+
  xlab("Year of Publication")

count_of_artistsggplot 

#Alone 

loadouts <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-01-24/loadouts.csv')
Rows: 940 Columns: 6
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (4): version, name, item_detailed, item
dbl (2): season, item_number

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
popularloadout <- loadouts %>%
  group_by(item) %>%
  count() %>%
treemap(
  index = "item",
  vSize = "n",
  title= "",
  inflate.labels =TRUE
  
)

age_gaps <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-02-14/age_gaps.csv', show_col_types = FALSE)

#which movies had couples with more than 40 years of age difference? 
highest_age_gap <- age_gaps %>%
select(movie_name,age_difference) %>%
  filter(age_difference > 40)

ggplot(highest_age_gap, aes(movie_name, age_difference))+
  geom_bar(stat = "identity", position = "dodge", fill="#541296" )