library(knitr)
library(rmdformats)
## Global options
options(max.print="75")
opts_chunk$set(echo=TRUE,
cache=TRUE,
prompt=FALSE,
tidy=TRUE,
comment=NA,
message=FALSE,
warning=FALSE)
opts_knit$set(width=75)# User 1 Kohsuke 2 gaku
#setwd("~Data")
#データの読み込み
Data2008<-read.csv("Data/h20nakamura.csv",header=TRUE,fileEncoding="CP932")
Data2009<-read.csv("Data/h21nakamura.csv",header=TRUE,fileEncoding="CP932")
Data2010<-read.csv("Data/h22nakamura_re.csv",header=TRUE,fileEncoding="CP932")
Data2011<-read.csv("Data/h23nakamura.csv",header=TRUE,fileEncoding="CP932")
Data2012<-read.csv("Data/h24nakamura.csv",header=TRUE,fileEncoding="CP932")
Data2013<-read.csv("Data/h25nakamura.csv",header=TRUE,fileEncoding="CP932")
Data2014<-read.csv("Data/h26nakamura.csv",header=TRUE,fileEncoding="CP932")
Data2015<-read.csv("Data/h27nakamura.csv",header=TRUE,fileEncoding="CP932")
Data2016<-read.csv("Data/h28nakamura.csv",header=TRUE,fileEncoding="CP932")
Data2017<-read.csv("Data/h29nakamura.csv",header=TRUE,fileEncoding="CP932")
#データの統合
Temp_Data<-rbind(Data2008,Data2009,Data2010,Data2011,Data2012,Data2013,Data2014,Data2015,Data2016,Data2017)
Temp_Data <- as.tibble(Temp_Data)
#単価の追加
Temp_Data = Temp_Data%>%
dplyr::mutate("単価" = as.numeric(Temp_Data$"仕切税抜金額"/Temp_Data$"仕切数量"))
#変数を英語に
names(Temp_Data)=c("Date","ShipperCode","Shipper","ClassificationCode","Classification","FishSpeciesCode","FishSpecies","StandardCode","Standard","Partition","Catch","Unit","Value","UnitPrice")
#種名を英語にする
name_japanese <- read.csv("Data/FishSpecies_Jp.csv",header=TRUE,fileEncoding = "CP932")
#Windowsではエンコードの関係でうまくread.csvだと日本語が読み込めないことがある。
#readrパッケージのread_csvで読み込むとうまくいく。
#英語にしたい日本語(一列目)と英語(二列目)を含んだデータセットを読み込む。
translator <- read.csv("Data/FishSpecies.csv",header=TRUE,fileEncoding = "CP932")
#日本語を英語にしていく。
names(translator)=c("jp","en"); En=merge(name_japanese,translator,by.x="jp",by.y="jp",all.x=T)
Temp<-merge(Temp_Data,translator,by.x="FishSpecies",by.y="jp",all=T)
Temp$Value=as.numeric(Temp$Value)
#日付のフォーマットを%Y%m%dにして、年と月を別列に追加
Main_Data = Temp %>%
mutate(Date2 = as.Date(as.character(Date),format="%Y%m%d")) %>%
mutate(Month = lubridate::month(Date2),Year=lubridate::year(Date2))%>%
na.omit()
Main_Data <- as.tibble(Main_Data)# クロス集計をおこないデータの概観の把握
# xtabs関数でモデル式で多次元分割表を作成
# https://teramonagi.hatenablog.com/entry/20150312/1426109245
Temp <- Main_Data
#Tempをファイルとして保存
saveRDS(Temp,file = "Temp")
Cross_Table_0 <- Temp %>%
xtabs(~FishSpecies+Month, .)
Cross_Table_0 <- as.data.frame(Cross_Table_0)
datatable(Cross_Table_0)Cross_Table_1 <- Temp %>%
xtabs(~FishSpecies+Year, .)
Cross_Table_1 <- as.data.frame(Cross_Table_1)
datatable(Cross_Table_1)Squid_Monthly = Cross_Table_0 %>%
filter(FishSpecies == "するめいか")
ggplot(Squid_Monthly) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = "するめいか") +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "スルメイカのデータ頻度") +
scale_fill_hue(name = "魚種名",labels = "スルメイカ")個人的なイメージとして10月・11月がデータ数が多くなると思ったが、7月のデータ数が最も多かった。だが全体的に夏から秋にかけてデータ数が多くなる。
Yellowtail_Monthly = Cross_Table_0 %>%
filter(FishSpecies == "ぶり")
ggplot(Yellowtail_Monthly) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = "ブリ") +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "ブリのデータ頻度") +
scale_fill_hue(name = "魚種名",labels = "ブリ")ブリの漁獲が多くなるのは冬だと思ってたが椴法華は秋である9月・10月がデータ数が最も多い。
Middle_Yellowtail_Monthly = Cross_Table_0 %>%
filter(FishSpecies == "いなだ")
ggplot(Middle_Yellowtail_Monthly) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = "イナダ") +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "イナダのデータ頻度") +
scale_fill_hue(name = "魚種名",labels = "イナダ")イナダもブリと同様に9月・10月にデータ数が最も多い。
Chum_Salmon_M_Monthly = Cross_Table_0 %>%
filter(FishSpecies == "さけオス")
ggplot(Chum_Salmon_M_Monthly) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = "サケオス") +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "サケオスのデータ頻度") +
scale_fill_hue(name = "魚種名",labels = "サケオス")サケはイメージ通り秋である9〜10月に漁獲が多いものと思われる。
Chum_Salmon_F_Monthly = Cross_Table_0 %>%
filter(FishSpecies == "さけメス")
ggplot(Chum_Salmon_F_Monthly) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = "サケメス") +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "サケメスのデータ頻度") +
scale_fill_hue(name = "魚種名",labels = "サケメス")サケはイメージ通り秋である9〜10月に漁獲が多いものと思われる。
Monthly_Data = Cross_Table_0 %>%
group_by(Month) %>%
summarise(Freq = sum(Freq))
ggplot(Monthly_Data) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = Month) +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "月毎のデータ頻度") +
scale_fill_hue(name = "月")データ頻度としては4月から10月・11月にかけて上昇傾向にあり12月は落ちている。 データ数は漁獲量・漁獲高との比例関係は見られない。
Yearly_Data_2008 = Cross_Table_3 %>%
filter(Year == "2008") %>%
group_by(Month) %>%
summarise(Freq = sum(Freq))
ggplot(Yearly_Data_2008) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = Month) +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "2008年月毎のデータ頻度") +
scale_fill_hue(name = "月")Yearly_Data_2009 = Cross_Table_3 %>%
filter(Year == "2009") %>%
group_by(Month) %>%
summarise(Freq = sum(Freq))
ggplot(Yearly_Data_2009) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = Month) +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "2009年月毎のデータ頻度") +
scale_fill_hue(name = "月")Yearly_Data_2010 = Cross_Table_3 %>%
filter(Year == "2010") %>%
group_by(Month) %>%
summarise(Freq = sum(Freq))
ggplot(Yearly_Data_2010) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = Month) +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "2010年月毎のデータ頻度") +
scale_fill_hue(name = "月")Yearly_Data_2011 = Cross_Table_3 %>%
filter(Year == "2011") %>%
group_by(Month) %>%
summarise(Freq = sum(Freq))
ggplot(Yearly_Data_2011) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = Month) +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "2011年月毎のデータ頻度") +
scale_fill_hue(name = "月")Yearly_Data_2012 = Cross_Table_3 %>%
filter(Year == "2012") %>%
group_by(Month) %>%
summarise(Freq = sum(Freq))
ggplot(Yearly_Data_2012) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = Month) +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "2012年月毎のデータ頻度") +
scale_fill_hue(name = "月")Yearly_Data_2013 = Cross_Table_3 %>%
filter(Year == "2013") %>%
group_by(Month) %>%
summarise(Freq = sum(Freq))
ggplot(Yearly_Data_2013) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = Month) +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "2013年月毎のデータ頻度") +
scale_fill_hue(name = "月")Yearly_Data_2014 = Cross_Table_3 %>%
filter(Year == "2014") %>%
group_by(Month) %>%
summarise(Freq = sum(Freq))
ggplot(Yearly_Data_2014) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = Month) +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "2014年月毎のデータ頻度") +
scale_fill_hue(name = "月")Yearly_Data_2015 = Cross_Table_3 %>%
filter(Year == "2015") %>%
group_by(Month) %>%
summarise(Freq = sum(Freq))
ggplot(Yearly_Data_2015) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = Month) +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "2015年月毎のデータ頻度") +
scale_fill_hue(name = "月")Yearly_Data_2016 = Cross_Table_3 %>%
filter(Year == "2016") %>%
group_by(Month) %>%
summarise(Freq = sum(Freq))
ggplot(Yearly_Data_2016) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = Month) +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "2016年月毎のデータ頻度") +
scale_fill_hue(name = "月")Yearly_Data_2017 = Cross_Table_3 %>%
filter(Year == "2017") %>%
group_by(Month) %>%
summarise(Freq = sum(Freq))
ggplot(Yearly_Data_2017) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
aes(x = Month,y = Freq,fill = Month) +
geom_bar(stat = "identity") +
labs(x = "月",y = "データ数",title = "2017年月毎のデータ頻度") +
scale_fill_hue(name = "月")各年の漁獲量・漁獲高を経年ごとに表示
Temp2 = Temp %>%
select(Date2,Year,Month,en,Catch,Value,UnitPrice) %>% #日付、年、月、漁獲量、漁獲高、単価を抜き出す
group_by(Year,en) %>%
summarise(Catch = (sum(Catch)/1000),Value = (sum(Value)/10000)) %>%
arrange(desc(Year))
#y軸のメモリを対数から指数に変換する
ScientificNotation <- function(l) {
l <- format(l, scientific = TRUE)
l <- gsub("^(.*)e", "'\\1'e", l)
l <- gsub("e\\+", "%*%10^", l)
l[1] <- "0"
parse(text = l)}Yearly_Catch_Value = Temp %>%
select(Date2,Year,Month,en,Catch,Value,UnitPrice) %>% #日付、年、月、漁獲量、漁獲高、単価を抜き出す
group_by(Year) %>%
summarise(Catch = (sum(Catch)/1000),Value = (sum(Value)/10000)) %>%
arrange(desc(Year))
ggplot(Yearly_Catch_Value) +
aes(x = Year,y = Catch,colour = "漁獲量") +
geom_line() + geom_point() +
scale_x_continuous(breaks = seq(2008,2017,3)) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量(トン)",title = "年間漁獲量の推移") +
scale_y_continuous(expand = c(0,0))+
expand_limits(y = 0)ggplot(Yearly_Catch_Value) +
aes(x = Year,y = Value,colour = "漁獲高") +
geom_line() + geom_point() +
scale_x_continuous(breaks = seq(2008,2017,3)) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高(万円)",title = "年間漁獲高の推移") +
scale_y_continuous(expand = c(0,0))+
expand_limits(y = 0)漁獲量は年々減少傾向にあり、2012年には1000トンを下回る。2014年にかけて回復するも2015年からは再び減少している。漁獲高は2億9千万から3億5千万を推移している。2012年には漁獲量ともに大きく減少している。これは漁獲物の単価が前年とあまり変化しないまま漁獲量が大きく減少したためと思われる。また2013年以降からの漁獲高が漁獲量に対してあまろ落ち込んでいないのは漁獲物の単価が上がったからだと思われる。
Temp <- Main_Data
#y軸のメモリを対数から指数に変換する
ScientificNotation <- function(l) {
l <- format(l, scientific = TRUE)
l <- gsub("^(.*)e", "'\\1'e", l)
l <- gsub("e\\+", "%*%10^", l)
l[1] <- "0"
parse(text = l)}
#月別の漁獲量と漁獲高をまとめる
Monthly_Catch_Value = Temp %>%
select(Date2,Year,Month,en,Catch,Value,UnitPrice) %>% #日付、年、月、漁獲量、漁獲高、単価を抜き出す
group_by(Year,Month) %>%
summarise(Catch = sum(Catch)/1000,Value = sum(Value)/10000) %>%
arrange(Year)Monthly_2008 = Monthly_Catch_Value %>%
filter(Year==2008)
ggplot(Monthly_2008) +
aes(x = Month,y = Catch,colour = "漁獲量") +
geom_line() + geom_point() +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量(トン)",title = "2008年月別漁獲量") ggplot(Monthly_2008) +
aes(x = Month,y = Value,colour = "漁獲高") +
geom_line() + geom_point() +
geom_hline(yintercept = 10000) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高(万円)",title = "2008年月別漁獲高") Monthly_2009 = Monthly_Catch_Value %>%
filter(Year==2009)
ggplot(Monthly_2009) +
aes(x = Month,y = Catch,colour = "漁獲量") +
geom_line() + geom_point() +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量(トン)",title = "2009年月別漁獲量") ggplot(Monthly_2009) +
aes(x = Month,y = Value,colour = "漁獲高") +
geom_line() + geom_point() +
geom_hline(yintercept = 10000) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高(万円)",title = "2009年月別漁獲高") Monthly_2010 = Monthly_Catch_Value %>%
filter(Year==2010)
ggplot(Monthly_2010) +
aes(x = Month,y = Catch,colour = "漁獲量") +
geom_line() + geom_point() +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量(トン)",title = "2010年月別漁獲量") ggplot(Monthly_2010) +
aes(x = Month,y = Value,colour = "漁獲高") +
geom_line() + geom_point() +
geom_hline(yintercept = 10000) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高(万円)",title = "2010年月別漁獲高") Monthly_2011 = Monthly_Catch_Value %>%
filter(Year==2011)
ggplot(Monthly_2011) +
aes(x = Month,y = Catch,colour = "漁獲量") +
geom_line() + geom_point() +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量(トン)",title = "2011年月別漁獲量") ggplot(Monthly_2011) +
aes(x = Month,y = Value,colour = "漁獲高") +
geom_line() + geom_point() +
geom_hline(yintercept = 10000) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高(万円)",title = "2011年月別漁獲高") Monthly_2012 = Monthly_Catch_Value %>%
filter(Year==2012)
ggplot(Monthly_2012) +
aes(x = Month,y = Catch,colour = "漁獲量") +
geom_line() + geom_point() +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量(トン)",title = "2012年月別漁獲量") ggplot(Monthly_2012) +
aes(x = Month,y = Value,colour = "漁獲高") +
geom_line() + geom_point() +
geom_hline(yintercept = 10000) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高(万円)",title = "2012年月別漁獲高") Monthly_2013 = Monthly_Catch_Value %>%
filter(Year==2013)
ggplot(Monthly_2013) +
aes(x = Month,y = Catch,colour = "漁獲量") +
geom_line() + geom_point() +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量(トン)",title = "2013年月別漁獲量") ggplot(Monthly_2013) +
aes(x = Month,y = Value,colour = "漁獲高") +
geom_line() + geom_point() +
geom_hline(yintercept = 10000) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高(万円)",title = "2013年月別漁獲高") Monthly_2014 = Monthly_Catch_Value %>%
filter(Year==2014)
ggplot(Monthly_2014) +
aes(x = Month,y = Catch,colour = "漁獲量") +
geom_line() + geom_point() +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量(トン)",title = "2014年月別漁獲量") ggplot(Monthly_2014) +
aes(x = Month,y = Value,colour = "漁獲高") +
geom_line() + geom_point() +
geom_hline(yintercept = 10000) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高(万円)",title = "2014年月別漁獲高") Monthly_2015 = Monthly_Catch_Value %>%
filter(Year==2015)
ggplot(Monthly_2015) +
aes(x = Month,y = Catch,colour = "漁獲量") +
geom_line() + geom_point() +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量(トン)",title = "2015年月別漁獲量") ggplot(Monthly_2015) +
aes(x = Month,y = Value,colour = "漁獲高") +
geom_line() + geom_point() +
geom_hline(yintercept = 10000) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高(万円)",title = "2015年月別漁獲高") Monthly_2016 = Monthly_Catch_Value %>%
filter(Year==2016)
ggplot(Monthly_2016) +
aes(x = Month,y = Catch,colour = "漁獲量") +
geom_line() + geom_point() +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量(トン)",title = "2016年月別漁獲量") ggplot(Monthly_2016) +
aes(x = Month,y = Value,colour = "漁獲高") +
geom_line() + geom_point() +
geom_hline(yintercept = 10000) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高(万円)",title = "2016年月別漁獲高") Monthly_2017 = Monthly_Catch_Value %>%
filter(Year==2017)
ggplot(Monthly_2017) +
aes(x = Month,y = Catch,colour = "漁獲量") +
geom_line() + geom_point() +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量(トン)",title = "2017年月別漁獲量") ggplot(Monthly_2017) +
aes(x = Month,y = Value,colour = "漁獲高") +
geom_line() + geom_point() +
geom_hline(yintercept = 10000) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高(万円)",title = "2017年月別漁獲高") #2008年から2017年までのデータを結合する
Monthly_int = rbind(Monthly_2008,Monthly_2009,Monthly_2010,Monthly_2011,Monthly_2012,Monthly_2013,
Monthly_2014, Monthly_2015,Monthly_2016,Monthly_2017)
ggplot(data = Monthly_int,aes(x = Month)) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(data = Monthly_int %>% filter(Year =="2008"),
aes(y = Catch,colour = "2008")) +
geom_line(data = Monthly_int %>% filter(Year =="2009"),
aes(y = Catch,colour = "2009")) +
geom_line(data = Monthly_int %>% filter(Year =="2010"),
aes(y = Catch,colour = "2010")) +
geom_line(data = Monthly_int %>% filter(Year =="2011"),
aes(y = Catch,colour = "2011")) +
geom_line(data = Monthly_int %>% filter(Year =="2012"),
aes(y = Catch,colour = "2012")) +
geom_line(data = Monthly_int %>% filter(Year =="2013"),
aes(y = Catch,colour = "2013")) +
geom_line(data = Monthly_int %>% filter(Year =="2014"),
aes(y = Catch,colour = "2014")) +
geom_line(data = Monthly_int %>% filter(Year =="2015"),
aes(y = Catch,colour = "2015")) +
geom_line(data = Monthly_int %>% filter(Year =="2016"),
aes(y = Catch,colour = "2016")) +
geom_line(data = Monthly_int %>% filter(Year =="2017"),
aes(y = Catch,colour = "2017")) +
labs(x = "月",y = "漁獲量(トン)",title = "10年間の月別漁獲量")ggplot(data = Monthly_int,aes(x = Month)) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(data = Monthly_int %>% filter(Year =="2008"),
aes(y = Value,colour = "2008")) +
geom_line(data = Monthly_int %>% filter(Year =="2009"),
aes(y = Value,colour = "2009")) +
geom_line(data = Monthly_int %>% filter(Year =="2010"),
aes(y = Value,colour = "2010")) +
geom_line(data = Monthly_int %>% filter(Year =="2011"),
aes(y = Value,colour = "2011")) +
geom_line(data = Monthly_int %>% filter(Year =="2012"),
aes(y = Value,colour = "2012")) +
geom_line(data = Monthly_int %>% filter(Year =="2013"),
aes(y = Value,colour = "2013")) +
geom_line(data = Monthly_int %>% filter(Year =="2014"),
aes(y = Value,colour = "2014")) +
geom_line(data = Monthly_int %>% filter(Year =="2015"),
aes(y = Value,colour = "2015")) +
geom_line(data = Monthly_int %>% filter(Year =="2016"),
aes(y = Value,colour = "2016")) +
geom_line(data = Monthly_int %>% filter(Year =="2017"),
aes(y = Value,colour = "2017")) +
geom_hline(yintercept = 10000) +
labs(x = "月",y = "漁獲高(万円)",title = "10年間の月別漁獲高") 漁獲量・漁獲高共に2008年から2017年までをまとめてプロットしたものである。2つのグラフからは季節性がうかがえる。
漁獲量は漁獲高と比較してばらつきが大きいものの、大きいピークは2010年と2011年とまとまっている。年ごとの漁獲量によってピークの大きさに差はあれど10月、11月がも最も漁獲されるつきであることがうかがえる。また、それらより小さいながらも7がちにピークが来ているものも確認できる。2011年と2014年である。ここは両方ともスルメイカが大漁した月である。
漁獲高は変動のばらつきが漁獲量より小さい。ピークは漁獲量と同様に7月、10月、11月である。漁獲量が大きくなるに比例して漁獲高も上がっていくことがうかがえる。
\(HHI = \sum_{i=1}^n {C_i}^2\)
HHI:Herfindahl-Hirschman Index 市場集中度を示す指数であり、市場に参入している企業の市場占有率(%)を2乗し、その総和で求められる。
HHIは独占状態の時10,000に近づき、完全競争状態に近づくにつれて0に近づく。 HHIが大きいほど少ない魚種で漁獲量・漁獲高の多くが占められていることがわかり、小さいと多くの魚種がそれぞれ細かい占有率を有していることがわかる。
つまり、HHIが大きいと特定の魚種に依存している傾向があり、小さいと多くの魚種に頼ることを示しているため、収入の多様性が大きくなる。
収入の多様性が多くなるということは収入の変動に対する抵抗性が大きくなることが言える。
\({C_i}^2\):i番目の事業分野占有率(%)
i:事業者数
それぞれの占有率を2乗すると少ない企業が産業の占有率大きく支配する時HHIの値は大きいものになる
→単に産業でどれほどの集中が起きているのかを表す指標として占有率より優れている
参考文献:Income diversification and risk for fishermen
\[HHI = \sum_{i=1}^{s_j} \sum_{j=1}^4 {p_{ij}}^2\]
\({p_{ij}}^2\):海域j、種群iに由来するここの収入の割合
j:海域 i:種群
上記の式のHHIはBering Sea/Aleutian Islands/Gulf of Alaska/WCの4つの海域の魚種ごとのHHIである。
同一魚種でも資源動態や管理方法が異なるため別種として扱っている。
\[HHI = \sum_{i=1}^n{p_i}^2\]
\({p_i}^2\):種群に由来する個々の収入
i:種群
上記のHHIの式は椴法華沖の1海域での魚種ごとのHHIである。
\[D = 1-\sum_{i=1}^n (\frac{n_i}{N})^2\]
Yearly_HHI = Temp %>%
select(Date2,Year,Month,en,Catch,Value,UnitPrice) %>% #日付、年、月、漁獲量、漁獲高、単価を抜き出す
group_by(Year,en) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = ((Catch/sum(Catch))*100),Percentage_Value = ((Value/sum(Value))*100)) %>%
mutate(HHI_Catch = (Percentage_Catch^2),HHI_Value = (Percentage_Value^2)) %>%
mutate(Percentage_HHI_Catch = ((HHI_Catch/sum(HHI_Catch)*100)),
Percentage_HHI_Value = ((HHI_Value/sum(HHI_Value))*100)) %>%
summarise(HHI_Catch = sum(HHI_Catch),HHI_Value = sum(HHI_Value)) %>%
arrange(Year)
ggplot(Yearly_HHI) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Year,y = HHI_Value,colour = "漁獲高")) +
labs(x = "年",y = "HHI",title = "年毎の漁獲量・漁獲高") +
scale_x_continuous(breaks = seq(2008,2017,3))HHIは2008年が異常に高い。これはスルメイカが他の漁獲物と比較してもかなりの量が漁獲されたからである。2008年のスルメイカの漁獲量のHHIは7554で漁獲高の方は6664と、双方でHHIのほぼ全てを占めている。これは漁獲物・収入ともにスルメイカに大きく依存していたことがうかがえる。
2009年には双方のHHIが急激に落ち込んでいる。スルメイカの漁獲量が前年に比べて落ち込んだのとサケの漁獲が多かったのが原因であると考えられる。サケの漁獲量自体はメスが178トン、オスが218トンと前年に比べて大きくなっていて、スルメイカと比較して単価が高いため漁獲量・漁獲高共にHHIを減少させた原因であると思われる。
2010年は漁獲量のHHIが減少し、漁獲高の方は上昇している。漁獲量のHHIが減少した理由としてはブリとイワシがまとまって漁獲されたからだと考えられる。ブリは159トン、イワシは209トンとスルメイカには大きく及ばないがHHIに影響はしている。ブリとイワシが漁獲高のHHIに大きく影響しないのは単価が低いため漁獲高の大きな貢献には繋がらないからである。一方、この年はスルメイカの単価が前年と比較して高かったため、漁獲量が少なくても漁獲高が大きかった。これが漁獲高のHHIを上昇させた原因であると考えられる。
2011年は2008年に次いでHHIの値が大きい。この年もスルメイカが漁獲のほぼ全てを占めている。イナダが191トン漁獲されるものの、スルメイカが1336トンと前年より漁獲されているため漁獲量のHHIは上昇している。漁獲高も前年と比較しても多く漁獲されていることから上昇している。HHIに対してスルメイカが占める割合が大きかった年である。
2012年は漁獲量・漁獲高共にHHIが落ち込んでいる。これは漁獲量・漁獲高共に急激に落ち込んだことが原因である。スルメイカの漁獲により多くを占められているが、漁獲量も多くないためHHIが減少している。
2013年はブリの漁獲量が大きく増加した。また、年々減少するスルメイカと比較してブリはまとまって漁獲されてきている。ブリの増加に伴ってイナダも増加してきている。漁獲量も漁獲高も多くはスルメイカが占めているが、ついでブリが占めるようになってきた。
2014年は漁獲高が10年間で最も高かった年であるが、漁獲高・漁獲量のHHIはそこまで高くない。スルメイカの漁獲量が減少してきてブリやイナダの漁獲量が大きくなってきた。しかし、スルメイカの単価は高く、ブリやイナダの単価は低いため漁獲高の多くは未だスルメイカが多くを占める。よって、漁獲高のHHIはスルメイカが多くを占めているため高く、漁獲量のHHIは低くなっている。
2015年は漁獲量のHHIの減少に比べて漁獲高のHHIの急激な減少が印象的に見える。これは1000トン近くの漁獲量があったスルメイカが249トンにまで激減しイナダが大量に漁獲され、単価の低いイナダでは漁獲高の大きな増加には繋がらなかったことが原因であると考えられる。スルメイカが単価が高いといえど249トンでは漁獲高の増加には繋がらない。
2016年はスルメイカの漁獲が100トン近く、2017年は65トンまで減少しており単価が高くても漁獲高の増加には繋がらない。スルメイカの代わりにブリとイナダが多く漁獲されてきた。しかし、ブリとイナダは単価が低いため漁獲高の多くを占めることができない。よって、漁獲量・漁獲高のHHIは集中しない。
Temp3 = Temp %>%
select(Date2,Year,Month,en,Catch,Value,UnitPrice) %>%
group_by(Year,Month) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = ((Catch/sum(Catch))*100),
Percentage_Value = ((Value/sum(Value))*100)) %>%
mutate(HHI_Catch = (Percentage_Catch^2),HHI_Value = (Percentage_Value^2)) %>%
mutate(Percentage_HHI_Catch = ((HHI_Catch/sum(HHI_Catch)*100)),
Percentage_HHI_Value = ((HHI_Value/sum(HHI_Value))*100)) %>%
arrange(Year)
HHI_2008 = Temp3 %>%
filter(Year == 2008) %>%
arrange(desc(Month))
ggplot(HHI_2008) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Month,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Month,y = HHI_Value,colour = "漁獲高")) +
labs(x = "月",y = "HHI",title = "2008年月別漁獲量・漁獲高のHHI") HHI_2009 = Temp3 %>%
filter(Year == 2009) %>%
arrange(desc(Month))
ggplot(HHI_2009) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Month,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Month,y = HHI_Value,colour = "漁獲高")) +
labs(x = "月",y = "HHI",title = "2009年月別漁獲量・漁獲高のHHI") HHI_2010 = Temp3 %>%
filter(Year == 2010) %>%
arrange(desc(Month))
ggplot(HHI_2010) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Month,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Month,y = HHI_Value,colour = "漁獲高")) +
labs(x = "月",y = "HHI",title = "2010年月別漁獲量・漁獲高のHHI") HHI_2011 = Temp3 %>%
filter(Year == 2011) %>%
arrange(desc(Month))
ggplot(HHI_2011) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Month,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Month,y = HHI_Value,colour = "漁獲高")) +
labs(x = "月",y = "HHI",title = "2011年月別漁獲量・漁獲高のHHI") HHI_2012 = Temp3 %>%
filter(Year == 2012) %>%
arrange(desc(Month))
ggplot(HHI_2012) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Month,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Month,y = HHI_Value,colour = "漁獲高")) +
labs(x = "月",y = "HHI",title = "2012年月別漁獲量・漁獲高のHHI") HHI_2013 = Temp3 %>%
filter(Year == 2013) %>%
arrange(desc(Month))
ggplot(HHI_2013) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Month,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Month,y = HHI_Value,colour = "漁獲高")) +
labs(x = "月",y = "HHI",title = "2013年月別漁獲量・漁獲高のHHI") HHI_2014 = Temp3 %>%
filter(Year == 2014) %>%
arrange(desc(Month))
ggplot(HHI_2014) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Month,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Month,y = HHI_Value,colour = "漁獲高")) +
labs(x = "月",y = "HHI",title = "2014年月別漁獲量・漁獲高のHHI") HHI_2015 = Temp3 %>%
filter(Year == 2015) %>%
arrange(desc(Month))
ggplot(HHI_2015) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Month,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Month,y = HHI_Value,colour = "漁獲高")) +
labs(x = "月",y = "HHI",title = "2015年月別漁獲量・漁獲高のHHI") HHI_2016 = Temp3 %>%
filter(Year == 2016) %>%
arrange(desc(Month))
ggplot(HHI_2016) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Month,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Month,y = HHI_Value,colour = "漁獲高")) +
labs(x = "月",y = "HHI",title = "2016年月別漁獲量・漁獲高のHHI") HHI_2017 = Temp3 %>%
filter(Year == 2017) %>%
arrange(desc(Month))
ggplot(HHI_2017) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Month,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Month,y = HHI_Value,colour = "漁獲高")) +
labs(x = "月",y = "HHI",title = "2017年月別漁獲量・漁獲高のHHI") HHI_int = rbind(HHI_2008,HHI_2009,HHI_2010,HHI_2011,HHI_2012,HHI_2013,HHI_2014,
HHI_2015,HHI_2016,HHI_2017)
ggplot(data =HHI_int,aes(x = Month)) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(data = HHI_int %>% filter(Year =="2008"),
aes(y = HHI_Catch,colour = "2008")) +
geom_line(data = HHI_int %>% filter(Year =="2009"),
aes(y = HHI_Catch,colour = "2009")) +
geom_line(data = HHI_int %>% filter(Year =="2010"),
aes(y = HHI_Catch,colour = "2010")) +
geom_line(data = HHI_int %>% filter(Year =="2011"),
aes(y = HHI_Catch,colour = "2011")) +
geom_line(data = HHI_int %>% filter(Year =="2012"),
aes(y = HHI_Catch,colour = "2012")) +
geom_line(data = HHI_int %>% filter(Year =="2013"),
aes(y = HHI_Catch,colour = "2013")) +
geom_line(data = HHI_int %>% filter(Year =="2014"),
aes(y = HHI_Catch,colour = "2014")) +
geom_line(data = HHI_int %>% filter(Year =="2015"),
aes(y = HHI_Catch,colour = "2015")) +
geom_line(data = HHI_int %>% filter(Year =="2016"),
aes(y = HHI_Catch,colour = "2016")) +
geom_line(data = HHI_int %>% filter(Year =="2017"),
aes(y = HHI_Catch,colour = "2017")) +
labs(x = "月",y = "HHI",title = "10年間の月別漁獲量のHHI")ggplot(data =HHI_int,aes(x = Month)) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(data = HHI_int %>% filter(Year =="2008"),
aes(y = HHI_Value,colour = "2008")) +
geom_line(data = HHI_int %>% filter(Year =="2009"),
aes(y = HHI_Value,colour = "2009")) +
geom_line(data = HHI_int %>% filter(Year =="2010"),
aes(y = HHI_Value,colour = "2010")) +
geom_line(data = HHI_int %>% filter(Year =="2011"),
aes(y = HHI_Value,colour = "2011")) +
geom_line(data = HHI_int %>% filter(Year =="2012"),
aes(y = HHI_Value,colour = "2012")) +
geom_line(data = HHI_int %>% filter(Year =="2013"),
aes(y = HHI_Value,colour = "2013")) +
geom_line(data = HHI_int %>% filter(Year =="2014"),
aes(y = HHI_Value,colour = "2014")) +
geom_line(data = HHI_int %>% filter(Year =="2015"),
aes(y = HHI_Value,colour = "2015")) +
geom_line(data = HHI_int %>% filter(Year =="2016"),
aes(y = HHI_Value,colour = "2016")) +
geom_line(data = HHI_int %>% filter(Year =="2017"),
aes(y = HHI_Value,colour = "2017")) +
labs(x = "月",y = "HHI",title = "10年間の月別漁獲高のHHI") 漁獲量のHHIは漁獲高のHHIに比べて変動が大きい。ピークとしてうかがえるのは7月、10月、11月で7月がピークの年は2011年と2014年であり、夏の時期のスルメイカやイワシが大量に漁獲されたのが原因であると考えられる。
漁獲高のHHIは漁獲量ほどHHIの変動が大きくない。ピークは漁獲量のHHIと一緒である。これらからHHIにも季節性があることがうかがえる。
Temp4 = Temp %>%
select(Date2,Year,Month,en,Catch,Value,UnitPrice) %>%
group_by(Year,en) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = ((Catch/sum(Catch))*100),
Percentage_Value = ((Value/sum(Value))*100)) %>%
mutate(HHI_Catch = (Percentage_Catch^2),
HHI_Value = (Percentage_Value^2)) %>%
mutate(Percentage_HHI_Catch = ((HHI_Catch/sum(HHI_Catch)*100)),
Percentage_HHI_Value = ((HHI_Value/sum(HHI_Value))*100)) %>%
arrange(Year) HHI_Squid = Temp4 %>%
filter(en == "Japanese_Common_Squid")
ggplot(HHI_Squid) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Year,y = HHI_Value,colour = "漁獲高")) +
labs(x = "年",y = "HHI",title = "年毎のスルメイカの漁獲量・漁獲高のHHI") +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
scale_x_continuous(breaks = seq(2008,2017,3))年々双方ともに減少傾向にあり、2015年からは漁獲量のHHIが100〜200程度までしか占めていない。2008年は明らかにスルメイカがHHIの多くを占めており、完全にスルメイカに依存していた経営であったことがうかがえる。
HHI_Yellowtail = Temp4 %>%
filter(en == "Yellowtail" | en == "Middle_Yellowtail")
#ブリ
ggplot(HHI_Yellowtail %>% filter(en =="Yellowtail")) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Year,y = HHI_Value,colour = "漁獲高")) +
labs(x = "年",y = "HHI",title = "年毎のブリの漁獲量・漁獲高のHHI") +
scale_x_continuous(breaks = seq(2008,2017,3))#イナダ
ggplot(HHI_Yellowtail %>% filter(en =="Middle_Yellowtail")) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Year,y = HHI_Value,colour = "漁獲高")) +
labs(x = "年",y = "HHI",title = "年毎のイナダの漁獲量・漁獲高のHHI") +
scale_x_continuous(breaks = seq(2008,2017,3))2013年あたりから漁獲量が増加し始めHHIの多くを占めるようになってきた。2015年はブリではなくイナダがHHIの多くを占めていた。スルメイカの漁獲が大幅に激減したのが2015年からなので2015年から2017年にかけて漁獲量・漁獲高のHHIが急増してきた。メイン魚種が交代したことがうかがえる。
HHI_Chum_Salmon = Temp4 %>%
filter(en == "Chum_Salmon_M" | en =="Chum_Salmon_F")
#サケオス
ggplot(HHI_Chum_Salmon %>% filter(en =="Chum_Salmon_M")) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Year,y = HHI_Value,colour = "漁獲高")) +
labs(x = "年",y = "HHI",title = "年毎のサケオスの漁獲量・漁獲高のHHI") +
scale_x_continuous(breaks = seq(2008,2017,3))#サケメス
ggplot(HHI_Chum_Salmon %>% filter(en =="Chum_Salmon_F")) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Year,y = HHI_Value,colour = "漁獲高")) +
labs(x = "年",y = "HHI",title = "年毎のサケメスの漁獲量・漁獲高のHHI") +
scale_x_continuous(breaks = seq(2008,2017,3))サケは2009年でのHHIの低下に大きく影響している。2009年はサケが例年より大量に漁獲され、漁獲量・漁獲高に大きく影響を与えた。サケの雄は漁獲量・漁獲高のHHI共に100もいってないが、メスのサケは単価が大きい分漁獲量が少なくても漁獲高には影響を与えることがわかり、これらにより漁獲高のHHIのメスのサケの割合が高くなり結果として2009年の全体のHHIは2008年より低い値になったものだと考えられる。
#スルメイカ
HHI_Squid = HHI_Squid %>%
mutate(Unitprice = Value/Catch)
#ブリ・イナダ
HHI_Yellowtail = HHI_Yellowtail %>%
mutate(Unitprice = Value/Catch)
#サケ
HHI_Chum_Salmon = HHI_Chum_Salmon %>%
mutate(Unitprice = Value/Catch)
#データを結合する
HHI_int = rbind(HHI_Squid,HHI_Yellowtail,HHI_Chum_Salmon)
ggplot(HHI_int) +
aes(x = Year,y = Unitprice,colour = en) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "単価(円)",title = "スルメイカ・ブリ・イナダ・サケの単価") +
geom_line() + geom_point() +
scale_x_continuous(breaks = seq(2008,2017,3)) +
scale_color_hue(name = "魚種名",
labels = c(Chum_Salmon_M = "サケオス", Chum_Salmon_F ="サケメス",
Yellowtail = "ブリ",Middle_Yellowtail = "イナダ",
Japanese_Common_Squid = "スルメイカ")) +
scale_y_continuous(expand = c(0,0),breaks = seq(0,1600,100))+
expand_limits(y = 0)スルメイカの単価が急上昇しているのが最も印象に残る。2015年を境にスルメイカの漁獲量が激減したため2016年からの単価が2倍以上に跳ね上がっている。2017年は65トンと最も少ない漁獲量であった。しかし、単価は500円を下回った。
ブリは2008年の単価が最高でありそこから200円と300円の間をうろついている。2013年の単価が急激に落ち込んでいる部分はブリの漁獲量が大きかった年である。2014年は前年より漁獲量が少なかったものの単価が高かったため漁獲量の増加につながった。
イナダは2008年から2010年にかけて減少傾向で2010年からは100円から150円の間で横ばいになった。
Yearly_Catch_Value_Squid = HHI_Squid %>%
select(Year,en,Catch,Value) %>%
summarise(Catch = Catch/1000,Value = Value/10000)
ggplot(Yearly_Catch_Value_Squid) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y =Catch,colour = "漁獲量")) +
scale_x_continuous(breaks = seq(2008,2017,3)) +
labs(x = "年",y = "漁獲量(トン)",title = "年毎のスルメイカの漁獲量") ggplot(Yearly_Catch_Value_Squid) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y =Value,colour = "漁獲高")) +
labs(x = "年",y = "漁獲高(万円)",title = "年毎のスルメイカの漁獲高") +
scale_x_continuous(breaks = seq(2008,2017,3)) +
scale_y_continuous(expand = c(0,0))+
expand_limits(y = 0) +
geom_hline(yintercept = 10000)Yearly_Catch_Value_Yellowtail = HHI_Yellowtail %>%
select(Year,en,Catch,Value) %>%
filter(en == "Yellowtail") %>%
summarise(Catch = Catch/1000,Value = Value/10000)
ggplot(Yearly_Catch_Value_Yellowtail) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = Catch,colour = "漁獲量")) +
labs(x = "年",y = "漁獲量(kg)") +
ggtitle("年毎のブリの漁獲量") +
scale_x_continuous(breaks = seq(2008,2017,3))ggplot(Yearly_Catch_Value_Yellowtail) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = Value,colour = "漁獲高")) +
labs(x = "年",y = "漁獲高") +
ggtitle("年毎のブリの漁獲高") +
scale_x_continuous(breaks = seq(2008,2017,3)) +
scale_y_continuous(expand = c(0,0))+
expand_limits(y = 0) +
geom_hline(yintercept = 10000)Yearly_Catch_Value_Middle_Yellowtail = HHI_Yellowtail %>%
select(Year,en,Catch,Value) %>%
filter(en == "Middle_Yellowtail") %>%
summarise(Catch = Catch/1000,Value = Value/10000)
ggplot(Yearly_Catch_Value_Yellowtail) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = Catch,colour = "漁獲量")) +
labs(x = "年",y = "漁獲量(kg)") +
ggtitle("年毎のイナダの漁獲量") +
scale_x_continuous(breaks = seq(2008,2017,3)) ggplot(Yearly_Catch_Value_Yellowtail) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = Value,colour = "漁獲高")) +
labs(x = "年",y = "漁獲高(万円)") +
ggtitle("年毎のイナダの漁獲高") +
scale_x_continuous(breaks = seq(2008,2017,3)) +
scale_y_continuous(expand = c(0,0))+
expand_limits(y = 0) +
geom_hline(yintercept = 10000)Yearly_Catch_Value_Chum_Salmon_F = HHI_Chum_Salmon %>%
select(Year,en,Catch,Value) %>%
filter(en == "Chum_Salmon_F") %>%
summarise(Catch = Catch/1000,Value = Value/10000)
ggplot(Yearly_Catch_Value_Chum_Salmon_F) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = Catch,colour = "漁獲量")) +
labs(x = "年",y = "漁獲量(kg)") +
ggtitle("年毎のサケメスの漁獲量") +
scale_x_continuous(breaks = seq(2008,2017,3)) ggplot(Yearly_Catch_Value_Chum_Salmon_F) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = Catch,colour = "漁獲高")) +
labs(x = "年",y = "漁獲高(万円)") +
ggtitle("年毎のサケメスの漁獲高") +
scale_x_continuous(breaks = seq(2008,2017,3)) +
scale_y_continuous(expand = c(0,0))+
expand_limits(y = 0) Yearly_Catch_Value_Chum_Salmon_M = HHI_Chum_Salmon %>%
select(Year,en,Catch,Value) %>%
filter(en == "Chum_Salmon_M") %>%
summarise(Catch = Catch/1000,Value = Value/10000)
ggplot(Yearly_Catch_Value_Chum_Salmon_M) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = Catch,colour = "漁獲量")) +
labs(x = "年",y = "漁獲量(kg)") +
ggtitle("年毎のサケオスの漁獲量") +
scale_x_continuous(breaks = seq(2008,2017,3)) ggplot(Yearly_Catch_Value_Chum_Salmon_M) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = Catch,colour = "漁獲高")) +
labs(x = "年",y = "漁獲高(万円)") +
ggtitle("年毎のサケオスの漁獲高") +
scale_x_continuous(breaks = seq(2008,2017,3)) +
scale_y_continuous(expand = c(0,0))+
expand_limits(y = 0) HHI_re_Squid = Temp %>%
select(Year,Month,en,Catch,Value,UnitPrice) %>%
filter(!en =="Japanese_Common_Squid") %>%
group_by(Year,en) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,Percentage_Value = (Value/sum(Value))*100) %>%
mutate(HHI_Catch = Percentage_Catch^2,HHI_Value = Percentage_Value^2) %>%
mutate(Percentage_HHI_Catch = (HHI_Catch/sum(HHI_Catch)),
Percentage_HHI_Value = (HHI_Value/sum(HHI_Value))) %>%
summarise(all_HHI_Catch = sum(HHI_Catch),all_HHI_Value = sum(HHI_Value)) %>%
arrange(Year)
ggplot(HHI_re_Squid) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = all_HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Year,y = all_HHI_Value,colour = "漁獲高")) +
scale_x_continuous(breaks = seq(2008,2017,3)) +
labs(x = "年",y = "HHI",title =
"スルメイカを抜いた場合の年毎の漁獲量・漁獲高のHHI") +
scale_y_continuous(expand = c(0,0))+
expand_limits(y = 0) HHI_re_Yellowtail = Temp %>%
select(Year,Month,en,Catch,Value,UnitPrice) %>%
filter(!en =="Yellowtail") %>%
group_by(Year,en) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,Percentage_Value = (Value/sum(Value))*100) %>%
mutate(HHI_Catch = Percentage_Catch^2,HHI_Value = Percentage_Value^2) %>%
mutate(Percentage_HHI_Catch = (HHI_Catch/sum(HHI_Catch)),
Percentage_HHI_Value = (HHI_Value/sum(HHI_Value))) %>%
summarise(all_HHI_Catch = sum(HHI_Catch),all_HHI_Value = sum(HHI_Value)) %>%
arrange(Year)
ggplot(HHI_re_Yellowtail) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = all_HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Year,y = all_HHI_Value,colour = "漁獲高")) +
scale_x_continuous(breaks = seq(2008,2017,3)) +
labs(x = "年",y = "HHI",title = "ブリを抜いた場合の年毎の漁獲量・漁獲高のHHI") +
scale_y_continuous(expand = c(0,0))+
expand_limits(y = 0) HHI_re_Middle_Yellowtail = Temp %>%
select(Year,Month,en,Catch,Value,UnitPrice) %>%
filter(!en =="Middle_Yellowtail") %>%
group_by(Year,en) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,Percentage_Value = (Value/sum(Value))*100) %>%
mutate(HHI_Catch = Percentage_Catch^2,HHI_Value = Percentage_Value^2) %>%
mutate(Percentage_HHI_Catch = (HHI_Catch/sum(HHI_Catch)),
Percentage_HHI_Value = (HHI_Value/sum(HHI_Value))) %>%
summarise(all_HHI_Catch = sum(HHI_Catch),all_HHI_Value = sum(HHI_Value)) %>%
arrange(Year)
ggplot(HHI_re_Middle_Yellowtail) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = all_HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Year,y = all_HHI_Value,colour = "漁獲高")) +
scale_x_continuous(breaks = seq(2008,2017,3)) +
labs(x = "年",y = "HHI",title = "イナダを抜いた場合の年毎の漁獲量・漁獲高のHHI") +
scale_y_continuous(expand = c(0,0))+
expand_limits(y = 0) HHI_re_Chum_Salmon_M = Temp %>%
select(Year,Month,en,Catch,Value,UnitPrice) %>%
filter(!en =="Chum_Salmon_M") %>%
group_by(Year,en) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,Percentage_Value = (Value/sum(Value))*100) %>%
mutate(HHI_Catch = Percentage_Catch^2,HHI_Value = Percentage_Value^2) %>%
mutate(Percentage_HHI_Catch = (HHI_Catch/sum(HHI_Catch)),
Percentage_HHI_Value = (HHI_Value/sum(HHI_Value))) %>%
summarise(all_HHI_Catch = sum(HHI_Catch),all_HHI_Value = sum(HHI_Value)) %>%
arrange(Year)
ggplot(HHI_re_Chum_Salmon_M) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = all_HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Year,y = all_HHI_Value,colour = "漁獲高")) +
scale_x_continuous(breaks = seq(2008,2017,3)) +
labs(x = "年",y = "HHI",title =
"サケオスを抜いた場合の年毎の漁獲量・漁獲高のHHI") +
scale_y_continuous(expand = c(0,0))+
expand_limits(y = 0) HHI_re_Chum_Salmon_F = Temp %>%
select(Year,Month,en,Catch,Value,UnitPrice) %>%
filter(!en =="Chum_Salmon_F") %>%
group_by(Year,en) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,Percentage_Value = (Value/sum(Value))*100) %>%
mutate(HHI_Catch = Percentage_Catch^2,HHI_Value = Percentage_Value^2) %>%
mutate(Percentage_HHI_Catch = (HHI_Catch/sum(HHI_Catch)),
Percentage_HHI_Value = (HHI_Value/sum(HHI_Value))) %>%
summarise(all_HHI_Catch = sum(HHI_Catch),all_HHI_Value = sum(HHI_Value)) %>%
arrange(Year)
ggplot(HHI_re_Chum_Salmon_F) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = all_HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x =Year,y = all_HHI_Value,colour = "漁獲高")) +
scale_x_continuous(breaks = seq(2008,2017,3)) +
labs(x = "年",y = "HHI",title = "サケメスを抜いた場合の漁獲量・漁獲高のHHI") +
scale_y_continuous(expand = c(0,0))+
expand_limits(y = 0) HHI_re_Chum_Salmon = Temp %>%
select(Year,Month,en,Catch,Value,UnitPrice) %>%
filter(!en =="Chum_Salmon_F") %>%
filter(!en =="Chum_Salmon_M") %>%
group_by(Year,en) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,Percentage_Value = (Value/sum(Value))*100) %>%
mutate(HHI_Catch = Percentage_Catch^2,HHI_Value = Percentage_Value^2) %>%
mutate(Percentage_HHI_Catch = (HHI_Catch/sum(HHI_Catch)),
Percentage_HHI_Value = (HHI_Value/sum(HHI_Value))) %>%
summarise(all_HHI_Catch = sum(HHI_Catch),all_HHI_Value = sum(HHI_Value)) %>%
arrange(Year)
ggplot(HHI_re_Chum_Salmon) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = all_HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Year,y = all_HHI_Value,colour = "漁獲高")) +
scale_x_continuous(breaks = seq(2008,2017,3)) +
labs(x = "年",y = "HHI",title = "サケを両方抜いた場合の年毎のHHI") +
scale_y_continuous(expand = c(0,0))+
expand_limits(y = 0) HHI_re_Squid_Yellowtail = Temp %>%
select(Year,Month,en,Catch,Value,UnitPrice) %>%
filter(!en =="Japanese_Common_Squid") %>%
filter(!en == "Yellowtail") %>%
filter(!en == "Active_Deadline_Yellowtail") %>%
group_by(Year,en) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,Percentage_Value = (Value/sum(Value))*100) %>%
mutate(HHI_Catch = Percentage_Catch^2,HHI_Value = Percentage_Value^2) %>%
mutate(Percentage_HHI_Catch = (HHI_Catch/sum(HHI_Catch)),
Percentage_HHI_Value = (HHI_Value/sum(HHI_Value))) %>%
summarise(all_HHI_Catch = sum(HHI_Catch),all_HHI_Value = sum(HHI_Value)) %>%
arrange(Year)
ggplot(HHI_re_Squid_Yellowtail) +
theme_light(base_size = 15,base_family = "HiraKakuProN-W3") +
geom_line(aes(x = Year,y = all_HHI_Catch,colour = "漁獲量")) +
geom_line(aes(x = Year,y = all_HHI_Value,colour = "漁獲高")) +
scale_x_continuous(breaks = seq(2008,2017,3)) +
labs(x = "年",y = "HHI",title = "スルメイカとブリを抜いた場合の年毎のHHI") +
scale_y_continuous(expand = c(0,0))+
expand_limits(y = 0) Main_Data$FishSpecies = as.character(Main_Data$FishSpecies)
Fish_Species2008 <- Main_Data %>%
select(FishSpecies,Year,Month,Catch,Value) %>%
filter(Year == 2008) %>%
mutate(FishSpecies = ifelse(FishSpecies %in% c("するめいか", "さけメス","さけオス","ぶり","いなだ"),FishSpecies, "その他")) %>%
group_by(FishSpecies) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,
percentage_Value = (Value/sum(Value))*100) %>%
arrange(desc(percentage_Value)) %>%
mutate(Year = 2008)
Fish_Species2008$Year = as.character(Fish_Species2008$Year)
c1 = ggplot(Fish_Species2008,aes(fill = FishSpecies,y = Percentage_Catch, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量の割合",title = "2008年の主要魚種の漁獲量の割合") +
scale_fill_hue(name = "魚種名")
print(c1)v1 = ggplot(Fish_Species2008,aes(fill = FishSpecies,y = percentage_Value, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高の割合",title = "2008年の主要魚種の漁獲高の割合") +
scale_fill_hue(name = "魚種名")
print(v1)Fish_Species2009 <- Main_Data %>%
select(FishSpecies,Year,Month,Catch,Value) %>%
filter(Year == 2009) %>%
mutate(FishSpecies = ifelse(FishSpecies %in% c("するめいか", "さけメス","さけオス","ぶり","いなだ"),FishSpecies, "その他")) %>%
group_by(FishSpecies) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,
percentage_Value = (Value/sum(Value))*100) %>%
arrange(desc(percentage_Value)) %>%
mutate(Year = 2009)
Fish_Species2009$Year = as.character(Fish_Species2009$Year)
c2 = ggplot(Fish_Species2009,aes(fill = FishSpecies,y = Percentage_Catch, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量の割合",title = "2009年の主要魚種の漁獲量の割合") +
scale_fill_hue(name = "魚種名")
print(c2)v2 = ggplot(Fish_Species2009,aes(fill = FishSpecies,y = percentage_Value, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高の割合",title = "2009年の主要魚種の漁獲高の割合") +
scale_fill_hue(name = "魚種名")
print(v2)Fish_Species2010 <- Main_Data %>%
select(FishSpecies,Year,Month,Catch,Value) %>%
filter(Year == 2010) %>%
mutate(FishSpecies = ifelse(FishSpecies %in% c("するめいか", "さけメス","さけオス","ぶり","いなだ"),FishSpecies, "その他")) %>%
group_by(FishSpecies) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,
percentage_Value = (Value/sum(Value))*100) %>%
arrange(desc(percentage_Value)) %>%
mutate(Year = 2010)
Fish_Species2010$Year = as.character(Fish_Species2010$Year)
c3 = ggplot(Fish_Species2010,aes(fill = FishSpecies,y = Percentage_Catch, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量の割合",title = "2010年の主要魚種の漁獲量の割合") +
scale_fill_hue(name = "魚種名")
print(c3)v3 = ggplot(Fish_Species2010,aes(fill = FishSpecies,y = percentage_Value, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高の割合",title = "2010年の主要魚種の漁獲高の割合") +
scale_fill_hue(name = "魚種名")
print(v3)Fish_Species2011 <- Main_Data %>%
select(FishSpecies,Year,Month,Catch,Value) %>%
filter(Year == 2011) %>%
mutate(FishSpecies = ifelse(FishSpecies %in% c("するめいか", "さけメス","さけオス","ぶり","いなだ"),FishSpecies, "その他")) %>%
group_by(FishSpecies) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,
percentage_Value = (Value/sum(Value))*100) %>%
arrange(desc(percentage_Value)) %>%
mutate(Year = 2011)
Fish_Species2011$Year = as.character(Fish_Species2011$Year)
c4 = ggplot(Fish_Species2011,aes(fill = FishSpecies,y = Percentage_Catch, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量の割合",title = "2011年の主要魚種の漁獲量の割合") +
scale_fill_hue(name = "魚種名")
print(c4)v4 = ggplot(Fish_Species2011,aes(fill = FishSpecies,y = percentage_Value, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高の割合",title = "2011年の主要魚種の漁獲高の割合") +
scale_fill_hue(name = "魚種名")
print(v4)Fish_Species2012 <- Main_Data %>%
select(FishSpecies,Year,Month,Catch,Value) %>%
filter(Year == 2012) %>%
mutate(FishSpecies = ifelse(FishSpecies %in% c("するめいか", "さけメス","さけオス","ぶり","いなだ"),FishSpecies, "その他")) %>%
group_by(FishSpecies) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,
percentage_Value = (Value/sum(Value))*100) %>%
arrange(desc(percentage_Value)) %>%
mutate(Year = 2012)
Fish_Species2012$Year = as.character(Fish_Species2012$Year)
c5 = ggplot(Fish_Species2012,aes(fill = FishSpecies,y = Percentage_Catch, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量の割合",title = "2012年の主要魚種の漁獲量の割合") +
scale_fill_hue(name = "魚種名")
print(c5)v5 = ggplot(Fish_Species2012,aes(fill = FishSpecies,y = percentage_Value, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高の割合",title = "2012年の主要魚種の漁獲高の割合") +
scale_fill_hue(name = "魚種名")
print(v5)Fish_Species2013 <- Main_Data %>%
select(FishSpecies,Year,Month,Catch,Value) %>%
filter(Year == 2013) %>%
mutate(FishSpecies = ifelse(FishSpecies %in% c("するめいか", "さけメス","さけオス","ぶり","いなだ"),FishSpecies, "その他")) %>%
group_by(FishSpecies) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,
percentage_Value = (Value/sum(Value))*100) %>%
arrange(desc(percentage_Value)) %>%
mutate(Year = 2013)
Fish_Species2013$Year = as.character(Fish_Species2013$Year)
c6 = ggplot(Fish_Species2013,aes(fill = FishSpecies,y = Percentage_Catch, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量の割合",title = "2013年の主要魚種の漁獲量の割合") +
scale_fill_hue(name = "魚種名")
print(c6)v6 = ggplot(Fish_Species2013,aes(fill = FishSpecies,y = percentage_Value, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高の割合",title = "2013年の主要魚種の漁獲高の割合") +
scale_fill_hue(name = "魚種名")
print(v6)Fish_Species2014 <- Main_Data %>%
select(FishSpecies,Year,Month,Catch,Value) %>%
filter(Year == 2014) %>%
mutate(FishSpecies = ifelse(FishSpecies %in% c("するめいか", "さけメス","さけオス","ぶり","いなだ"),FishSpecies, "その他")) %>%
group_by(FishSpecies) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,
percentage_Value = (Value/sum(Value))*100) %>%
arrange(desc(percentage_Value)) %>%
mutate(Year = 2014)
Fish_Species2014$Year = as.character(Fish_Species2014$Year)
c7 = ggplot(Fish_Species2014,aes(fill = FishSpecies,y = Percentage_Catch, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量の割合",title = "2014年の主要魚種の漁獲量の割合") +
scale_fill_hue(name = "魚種名")
print(c7)v7 = ggplot(Fish_Species2014,aes(fill = FishSpecies,y = percentage_Value, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高の割合",title = "2014年の主要魚種の漁獲高の割合") +
scale_fill_hue(name = "魚種名")
print(v7)Fish_Species2015 <- Main_Data %>%
select(FishSpecies,Year,Month,Catch,Value) %>%
filter(Year == 2015) %>%
mutate(FishSpecies = ifelse(FishSpecies %in% c("するめいか", "さけメス","さけオス","ぶり","いなだ"),FishSpecies, "その他")) %>%
group_by(FishSpecies) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,
percentage_Value = (Value/sum(Value))*100) %>%
arrange(desc(percentage_Value)) %>%
mutate(Year = 2015)
Fish_Species2015$Year = as.character(Fish_Species2015$Year)
c8 = ggplot(Fish_Species2015,aes(fill = FishSpecies,y = Percentage_Catch, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量の割合",title = "2015年の主要魚種の漁獲量の割合") +
scale_fill_hue(name = "魚種名")
print(c8)v8 = ggplot(Fish_Species2015,aes(fill = FishSpecies,y = percentage_Value, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高の割合",title = "2015年の主要魚種の漁獲高の割合") +
scale_fill_hue(name = "魚種名")
print(v8)Fish_Species2016 <- Main_Data %>%
select(FishSpecies,Year,Month,Catch,Value) %>%
filter(Year == 2016) %>%
mutate(FishSpecies = ifelse(FishSpecies %in% c("するめいか", "さけメス","さけオス","ぶり","いなだ"),FishSpecies, "その他")) %>%
group_by(FishSpecies) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,
percentage_Value = (Value/sum(Value))*100) %>%
arrange(desc(percentage_Value)) %>%
mutate(Year = 2016)
Fish_Species2016$Year = as.character(Fish_Species2016$Year)
c9 = ggplot(Fish_Species2016,aes(fill = FishSpecies,y = Percentage_Catch, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量の割合",title = "2013年の主要魚種の漁獲量の割合") +
scale_fill_hue(name = "魚種名")
print(c9)v9 = ggplot(Fish_Species2016,aes(fill = FishSpecies,y = percentage_Value, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高の割合",title = "2016年の主要魚種の漁獲高の割合") +
scale_fill_hue(name = "魚種名")
print(v9)Fish_Species2017 <- Main_Data %>%
select(FishSpecies,Year,Month,Catch,Value) %>%
filter(Year == 2017) %>%
mutate(FishSpecies = ifelse(FishSpecies %in% c("するめいか", "さけメス","さけオス","ぶり","いなだ"),FishSpecies, "その他")) %>%
group_by(FishSpecies) %>%
summarise(Catch = sum(Catch),Value = sum(Value)) %>%
mutate(Percentage_Catch = (Catch/sum(Catch))*100,
percentage_Value = (Value/sum(Value))*100) %>%
arrange(desc(percentage_Value)) %>%
mutate(Year = 2017)
Fish_Species2017$Year = as.character(Fish_Species2017$Year)
c10 = ggplot(Fish_Species2017,aes(fill = FishSpecies,y = Percentage_Catch, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量の割合",title = "2017年の主要魚種の漁獲量の割合") +
scale_fill_hue(name = "魚種名")
print(c10) v10 = ggplot(Fish_Species2017,aes(fill = FishSpecies,y = percentage_Value, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.3) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲高の割合",title = "2017年の主要魚種の漁獲高の割合") +
scale_fill_hue(name = "魚種名")
print(v10)Fish_Species_int = rbind(Fish_Species2008,Fish_Species2009,Fish_Species2010,
Fish_Species2011,Fish_Species2012,Fish_Species2013,
Fish_Species2014,Fish_Species2015,Fish_Species2016,
Fish_Species2017)
ggplot(Fish_Species_int,aes(fill = FishSpecies,y = Percentage_Catch, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.7) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量の割合",title = "2008年から2017年の主要魚種の漁獲量の割合") +
scale_fill_hue(name = "魚種名")ggplot(Fish_Species_int,aes(fill = FishSpecies,y = percentage_Value, x = Year)) +
geom_bar(stat = "identity",position = "fill",width = 0.7) +
theme_light(base_rect_size = 15,base_family = "HiraKakuProN-W3") +
labs(x = "年",y = "漁獲量の割合",title = "2008年から2017年の主要魚種の漁獲高の割合") +
scale_fill_hue(name = "魚種名")