【R】都道府県別 産業別従事比率
2020年3月8日
総務省統計局が発表している「統計でみる都道府県のすがた2020」から、都道府県別の第1次産業就業者比率(%、対就業者)、第2次産業就業者比率(%、対就業者)、第3次産業就業者比率(%、対就業者)を表示します。2015年のデータです。
library(leaflet)
library(knitr)
library(kableExtra)
library(dplyr)
library(tidyr)
library(stringr)
dat <- read.csv("http://www.dinov.tokyo/Data/JP_Pref/Pref_data.csv", header = TRUE, fileEncoding="UTF-8")
col_start <- 0.2
col_end <- 0.0
table_df<-data.frame(都道府県=dat$都道府県, 第1次産業従事率=dat$第1次率, 第2次産業従事率=dat$第2次率, 第3次産業従事率=dat$第3次率)
datc_k <- cut(dat$第1次率, hist(dat$第1次率, plot=FALSE)$breaks, right=FALSE)
datc_kcol <- rainbow(length(levels(datc_k)), start = col_start, end=col_end)[as.integer(datc_k)]
datc_m <- cut(dat$第2次率, hist(dat$第2次率, plot=FALSE)$breaks, right=FALSE)
datc_mcol <- rainbow(length(levels(datc_m)), start = col_start, end=col_end)[as.integer(datc_m)]
datc_s <- cut(dat$第3次率, hist(dat$第3次率, plot=FALSE)$breaks, right=FALSE)
datc_scol <- rainbow(length(levels(datc_s)), start = col_start, end=col_end)[as.integer(datc_s)]
windowsFonts(JP4=windowsFont("Biz Gothic"))
windows(width=2000, height=800)
par(family="JP4")
layout(matrix(1:3, 1, 3))
library(NipponMap)
JapanPrefMap(datc_kcol, main="第1次産業従事率 %")
legend("bottomright", fill=rainbow(length(levels(datc_k)), start = col_start, end=col_end), legend=names(table(datc_k)))
JapanPrefMap(datc_mcol, main="第2次産業従事率 %")
legend("bottomright", fill=rainbow(length(levels(datc_m)), start = col_start, end=col_end), legend=names(table(datc_m)))
JapanPrefMap(datc_scol, main="第3次産業従事率 %")
legend("bottomright", fill=rainbow(length(levels(datc_s)), start = col_start, end=col_end), legend=names(table(datc_s)))
library(clipr)
kable(table_df, align = "c") %>%
kable_styling(full_width = F) %>%
column_spec(1, bold = T) %>%
collapse_rows(columns = 1, valign = "middle") %>%
write_clip

| 都道府県 | 第1次産業従事率 | 第2次産業従事率 | 第3次産業従事率 |
|---|---|---|---|
| 北海道 | 7.0 | 16.9 | 70.6 |
| 青森 | 12.0 | 19.8 | 65.1 |
| 岩手 | 10.6 | 25.1 | 62.9 |
| 宮城 | 4.4 | 22.9 | 70.5 |
| 秋田 | 9.6 | 24.0 | 64.7 |
| 山形 | 9.2 | 28.4 | 60.2 |
| 福島 | 6.5 | 29.4 | 60.2 |
| 茨城 | 5.6 | 28.5 | 61.7 |
| 栃木 | 5.5 | 30.7 | 60.1 |
| 群馬 | 5.0 | 30.8 | 61.2 |
| 埼玉 | 1.6 | 23.1 | 67.9 |
| 千葉 | 2.8 | 19.4 | 72.3 |
| 東京 | 0.4 | 15.3 | 72.1 |
| 神奈川 | 0.8 | 21.0 | 72.1 |
| 新潟 | 5.8 | 28.3 | 63.9 |
| 富山 | 3.3 | 33.1 | 62.1 |
| 石川 | 3.0 | 27.4 | 65.5 |
| 福井 | 3.7 | 30.7 | 63.8 |
| 山梨 | 7.2 | 27.8 | 62.9 |
| 長野 | 9.1 | 28.5 | 60.1 |
| 岐阜 | 3.1 | 32.1 | 61.8 |
| 静岡 | 3.8 | 32.2 | 60.9 |
| 愛知 | 2.1 | 32.0 | 61.3 |
| 三重 | 3.6 | 31.0 | 62.1 |
| 滋賀 | 2.6 | 32.6 | 61.1 |
| 京都 | 2.1 | 21.6 | 67.7 |
| 大阪 | 0.5 | 22.2 | 68.5 |
| 兵庫 | 2.0 | 25.0 | 69.0 |
| 奈良 | 2.6 | 22.6 | 71.6 |
| 和歌山 | 8.8 | 21.7 | 66.7 |
| 鳥取 | 8.8 | 21.3 | 66.9 |
| 島根 | 7.8 | 22.5 | 67.3 |
| 岡山 | 4.6 | 26.1 | 64.4 |
| 広島 | 3.1 | 26.0 | 67.7 |
| 山口 | 4.8 | 25.6 | 67.5 |
| 徳島 | 8.2 | 23.4 | 65.3 |
| 香川 | 5.3 | 25.1 | 66.6 |
| 愛媛 | 7.3 | 23.1 | 64.8 |
| 高知 | 11.4 | 16.6 | 68.7 |
| 福岡 | 2.8 | 20.2 | 72.1 |
| 佐賀 | 8.4 | 23.5 | 65.0 |
| 長崎 | 7.4 | 19.5 | 69.9 |
| 熊本 | 9.6 | 20.6 | 67.5 |
| 大分 | 6.7 | 22.3 | 66.5 |
| 宮崎 | 10.8 | 20.6 | 66.5 |
| 鹿児島 | 9.3 | 19.1 | 69.7 |
| 沖縄 | 4.5 | 13.8 | 73.5 |