【R】都道府県別 学習時間
2020年4月15日
総務省統計局が発表している「都道府県・市区町村のすがた(社会・人口統計体系)」から、都道府県別の学習・自己啓発・訓練の平均時間(学業以外)(分、有業者、2016年)を男女別に表示します。
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$都道府県, 学習時間_男=dat$学習時間_男, 学習時間_女=dat$学習時間_女)
datc_k <- cut(dat$学習時間_男, hist(dat$学習時間_男, 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$学習時間_女, hist(dat$学習時間_女, plot=FALSE)$breaks, right=FALSE)
datc_mcol <- rainbow(length(levels(datc_m)), start = col_start, end=col_end)[as.integer(datc_m)]
windowsFonts(JP4=windowsFont("Biz Gothic"))
windows(width=1600, height=800)
par(family="JP4")
layout(matrix(1:2, 1, 2))
library(NipponMap)
JapanPrefMap(datc_kcol, main="学習時間_男 分")
legend("bottomright", fill=rainbow(length(levels(datc_k)), start = col_start, end=col_end), legend=names(table(datc_k)))
JapanPrefMap(datc_mcol, main="学習時間_女 分")
legend("bottomright", fill=rainbow(length(levels(datc_m)), start = col_start, end=col_end), legend=names(table(datc_m)))
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

| 都道府県 | 学習時間_男 | 学習時間_女 |
|---|---|---|
| 北海道 | 7 | 4 |
| 青森 | 3 | 2 |
| 岩手 | 4 | 7 |
| 宮城 | 5 | 5 |
| 秋田 | 4 | 4 |
| 山形 | 4 | 3 |
| 福島 | 4 | 3 |
| 茨城 | 7 | 4 |
| 栃木 | 5 | 7 |
| 群馬 | 5 | 3 |
| 埼玉 | 7 | 7 |
| 千葉 | 7 | 8 |
| 東京 | 8 | 9 |
| 神奈川 | 9 | 9 |
| 新潟 | 3 | 3 |
| 富山 | 5 | 5 |
| 石川 | 6 | 5 |
| 福井 | 6 | 5 |
| 山梨 | 5 | 5 |
| 長野 | 6 | 4 |
| 岐阜 | 6 | 6 |
| 静岡 | 6 | 6 |
| 愛知 | 5 | 7 |
| 三重 | 6 | 5 |
| 滋賀 | 6 | 6 |
| 京都 | 9 | 6 |
| 大阪 | 7 | 9 |
| 兵庫 | 6 | 8 |
| 奈良 | 8 | 7 |
| 和歌山 | 6 | 5 |
| 鳥取 | 4 | 7 |
| 島根 | 5 | 5 |
| 岡山 | 7 | 7 |
| 広島 | 7 | 4 |
| 山口 | 8 | 8 |
| 徳島 | 4 | 6 |
| 香川 | 4 | 4 |
| 愛媛 | 5 | 4 |
| 高知 | 7 | 8 |
| 福岡 | 5 | 6 |
| 佐賀 | 5 | 6 |
| 長崎 | 4 | 5 |
| 熊本 | 5 | 6 |
| 大分 | 4 | 5 |
| 宮崎 | 3 | 3 |
| 鹿児島 | 4 | 4 |
| 沖縄 | 4 | 5 |
ビックリしたのですが、この数字は本当なのでしょうか?どういう風に調査したか知りませんが、あまりにも少なすぎる気がします。これが本当なら、グローバル社会で日本が生き残れるはずがありません。