資料出所:
https://www.city.kitakyushu.lg.jp/contents/924_00918.html
https://www.city.kitakyushu.lg.jp/page/toukei/sougou/tyouki/18/1802.xls
library(readr)
## Warning: パッケージ 'readr' はバージョン 4.2.3 の R の下で造られました
tax <- read_csv("data/tax1802.csv", show_col_types = FALSE)
tax <- tax[,c(1,2,4,6,8,10)]
colnames(tax) <- c("year","a.総額","b.市民税","c.固定資産税","d.事業所税","e.その他")
tax[,1] <- 1975:2022
tax
## # A tibble: 48 × 6
## year a.総額 b.市民税 c.固定資産税 d.事業所税 e.その他
## <int> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 1975 48246337 19002860 20667770 682425 7893282
## 2 1976 57143537 20996310 23703937 3380943 9062347
## 3 1977 68281606 25602624 27812493 3741387 11125102
## 4 1978 74877876 27455425 31122447 3480178 12819826
## 5 1979 85950992 34063369 33765917 4045921 14075785
## 6 1980 96859176 40409531 36289277 4173278 15987090
## 7 1981 103724384 44464169 37201603 5039269 17019343
## 8 1982 108766309 45124878 39848288 5715148 18077995
## 9 1983 114174933 45342355 43998935 5706755 19126888
## 10 1984 120972793 47405015 47595439 5781770 20190569
## # ℹ 38 more rows
dat <- tax
library(tidyverse)
dat_l <- gather(dat, "key", "value", -year)
dat_l
## # A tibble: 240 × 3
## year key value
## <int> <chr> <dbl>
## 1 1975 a.総額 48246337
## 2 1976 a.総額 57143537
## 3 1977 a.総額 68281606
## 4 1978 a.総額 74877876
## 5 1979 a.総額 85950992
## 6 1980 a.総額 96859176
## 7 1981 a.総額 103724384
## 8 1982 a.総額 108766309
## 9 1983 a.総額 114174933
## 10 1984 a.総額 120972793
## # ℹ 230 more rows
library(ggplot2)
#options(scipen=100)
ggplot(dat_l,aes(x=year,y=value,col=key))+
#geom_point()+
geom_line()+
labs(x="年度", y="金額",title = "市税決算額(北九州市)", subtitle = "単位:1,000円",colour="凡例")+
theme_minimal(base_family = "HiraKakuProN-W3")
library(ggplot2)
#options(scipen=100)
ggplot(dat_l,aes(x=year,y=value,col=key))+
geom_point(size=1)+
geom_line()+
labs(x="年度", y="金額",title = "市税決算額(北九州市)", subtitle = "単位:1,000円",colour="凡例")+
theme_grey(base_family = "HiraKakuProN-W3")
library(ggplot2)
#options(scipen=100)
ggplot(dat_l,aes(x=year,y=value,col=key))+
xlim(1990,2022)+
geom_point(size=1)+
geom_line()+
labs(x="年度", y="金額",title = "市税決算額(北九州市)", subtitle = "単位:1,000円",colour="凡例")+
theme_grey(base_family = "HiraKakuProN-W3")