rm(list  =  ls())

if(!require("pacman")) install.packages("pacman")
##  要求されたパッケージ pacman をロード中です
pacman::p_load("tidyverse",  
               "skimr",    
               "gt")     
 options(scipen = 999)
 
 dat_temp <- read_csv("QFR2023TermPaper.csv")
## New names:
## Rows: 350 Columns: 5
## ── Column specification
## ────────────────────────────────────────────────────────
## Delimiter: "," chr (1): Fish_Market dbl (4): ...1, Year, Month, Total
## ℹ 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.
## • `` -> `...1`
skimr::skim(dat_temp)
Data summary
Name dat_temp
Number of rows 350
Number of columns 5
_______________________
Column type frequency:
character 1
numeric 4
________________________
Group variables None

Variable type: character

skim_variable n_missing complete_rate min max empty n_unique whitespace
Fish_Market 0 1 8 8 0 2 0

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
…1 0 1 175.50 101.18 1 88.25 175.5 262.75 350 ▇▇▇▇▇
Year 0 1 2005.13 6.92 1994 1999.00 2005.0 2011.00 2019 ▇▇▇▆▃
Month 0 1 8.33 2.91 1 7.00 9.0 11.00 12 ▂▁▅▆▇
Total 0 1 2317.37 3038.65 0 1.00 640.0 4176.50 13095 ▇▂▂▁▁
summary_1 <- dat_temp |> group_by(Year, Month) |>
  mutate(Month=as.integer(Month),Year=as.integer(Year))|>ungroup()
fig_1 <- ggplot(summary_1, aes(x = Month, y = Total, fill = Year)) + geom_bar(stat = "identity", position = "dodge")+
scale_x_continuous(breaks = seq(1,12,1))

fig_1