【R】都道府県別 大豆生産量
2020年1月24日
					農林水産省が公表している 作物統計調査 から平成29年(2017年)都道府県別の大豆出荷量を地図に描画します。出荷量が不明の都道府県は0にしています。
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$都道府県, 出荷量t=dat$大豆)
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=800, height=800)
par(family="JP4")
library(NipponMap)
JapanPrefMap(datc_mcol, main="平成29年 都道府県別 大豆出荷量 t  (農林水産省より) ")
legend("bottomright", fill=rainbow(length(levels(datc_m)), start = col_start, end=col_end), legend=names(table(datc_m)))
kable(table_df, align = "c") %>%
  kable_styling(full_width = F) %>%
  column_spec(1, bold = T) %>%
  collapse_rows(columns = 1, valign = "middle") 

| 都道府県 | 出荷量t | 
|---|---|
| 北海道 | 100500 | 
| 青森 | 6270 | 
| 岩手 | 5380 | 
| 宮城 | 15600 | 
| 秋田 | 10500 | 
| 山形 | 7440 | 
| 福島 | 1800 | 
| 茨城 | 4730 | 
| 栃木 | 4120 | 
| 群馬 | 354 | 
| 埼玉 | 930 | 
| 千葉 | 1010 | 
| 東京 | 9 | 
| 神奈川 | 60 | 
| 新潟 | 9240 | 
| 富山 | 8130 | 
| 石川 | 2600 | 
| 福井 | 2780 | 
| 山梨 | 270 | 
| 長野 | 3490 | 
| 岐阜 | 3400 | 
| 静岡 | 293 | 
| 愛知 | 6430 | 
| 三重 | 4110 | 
| 滋賀 | 9310 | 
| 京都 | 359 | 
| 大阪 | 19 | 
| 兵庫 | 2710 | 
| 奈良 | 179 | 
| 和歌山 | 28 | 
| 鳥取 | 906 | 
| 島根 | 1120 | 
| 岡山 | 1990 | 
| 広島 | 589 | 
| 山口 | 1070 | 
| 徳島 | 19 | 
| 香川 | 70 | 
| 愛媛 | 421 | 
| 高知 | 51 | 
| 福岡 | 13500 | 
| 佐賀 | 15100 | 
| 長崎 | 525 | 
| 熊本 | 3440 | 
| 大分 | 1580 | 
| 宮崎 | 261 | 
| 鹿児島 | 325 | 
| 沖縄 | 0 | 
北海道が圧倒的すぎます。表示方法を考えないとダメだな。。。
出典:農林水産省 2017年 作物統計調査 平成29年産野菜生産出荷統計