generated from LCRoysterproject/bookdown-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path06-landings.Rmd
189 lines (158 loc) · 7.72 KB
/
06-landings.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
---
output:
pdf_document: default
html_document: default
---
\newpage
# Oyster Landings Figures
This data set is manually updated by the oyster landings data located here: https://public.myfwc.com/FWRI/PFDM/ReportCreator.aspx. The Commercial Fisheries Landings Summaries allows the user to select the date year range and oysters (as the Species).
The Suwannee counties used in these figures are TAYLOR, DIXIE, and LEVY.
The Apalachicola counties used iin these figures are FRANKLIN and WAKULLA.
The State of Florida data are all of the counties in Florida where oysters are landed, and this is selected in the FWC Commercial Fisheries Landings Summaries website.
Data shown in the plots from the current year are considered provisional and only contain reported data up until this point in the year.
```{r landings_options setup, include=FALSE, warning=FALSE, message=FALSE, comment=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library("cowplot")
library("ggplot2")
library("ggpubr")
library("grid")
library("gridExtra")
library("lattice")
library("marelac")
library("scales")
library("ggpubr")
library("tidyverse")
```
```{r ,include=FALSE, warning=FALSE, message=FALSE, comment=FALSE}
startYear = 1986
endYear = as.numeric(format(Sys.Date(), "%Y"))
### Reading in the csv
county_landings<- read.csv("data/oys_landings/ReportCreatorResults-County.csv", header= T, skip = 9)
### Manipulating the county data to only display Apalachicola Counties
apalach <- county_landings %>%
filter (County.Landed== "FRANKLIN" | County.Landed=="WAKULLA")%>%
select(Year, Pounds, Trips) %>%
group_by(Year) %>%
mutate(pounds_sum= sum (Pounds)) %>%
mutate(trips_sum= sum (Trips)) %>%
mutate (per_trip= pounds_sum/trips_sum) %>% #<- calculating per trips
filter (! duplicated(Year)) %>%
rename ("Landings (lbs)"= pounds_sum, "Total Trips"= trips_sum, "CPUE"= per_trip) %>%
gather(value, measurement, c("Landings (lbs)", "Total Trips", "CPUE")) %>%
group_by (Year, value) %>%
summarise(measurement=measurement) %>%
add_column(area= "Apalachicola")
apalach_df<- data.frame(apalach)
### Manipulating the county data to only display Suwannee Counties
suwannee <- county_landings %>%
filter (County.Landed== "TAYLOR" | County.Landed=="DIXIE" | County.Landed=="LEVY") %>% #<- filtering out counties
select(Year, Pounds, Trips) %>%
group_by(Year) %>%
mutate(pounds_sum= sum (Pounds)) %>%
mutate(trips_sum= sum (Trips)) %>%
mutate (per_trip= pounds_sum/trips_sum) %>% #<- calculating per trips
filter (! duplicated(Year)) %>%
rename ("Landings (lbs)"= pounds_sum, "Total Trips"= trips_sum, "CPUE"= per_trip) %>%
gather(value, measurement, c("Landings (lbs)", "Total Trips", "CPUE")) %>%
group_by (Year, value) %>%
summarise(measurement=measurement) %>%
add_column(area= "Suwannee Sound")
suwannee_df<- data.frame(suwannee)
### Manipulating the county data to only display all Counties
state <- county_landings %>%
select(Year, Pounds, Trips) %>%
group_by(Year) %>%
mutate(pounds_sum= sum (Pounds)) %>%
mutate(trips_sum= sum (Trips)) %>%
mutate (per_trip= pounds_sum/trips_sum) %>% #<- calculating per trips
filter (! duplicated(Year)) %>%
rename ("Landings (lbs)"= pounds_sum, "Total Trips"= trips_sum, "CPUE"= per_trip) %>%
gather(value, measurement, c("Landings (lbs)", "Total Trips", "CPUE")) %>%
group_by (Year, value) %>%
summarise(measurement=measurement) %>%
add_column(area= "State")
state_df<- data.frame(state)
### Merging all dataframes for easy facet_wrapping, needed to be in data.frame for rbind to function
all_landings <- rbind(apalach_df, suwannee_df, state_df)
all_landings<- all_landings %>%
na.omit(value) %>%
na.omit(area)
all_landings$area<- factor(all_landings $area,levels=c ("Apalachicola", "Suwannee Sound", "State"))
all_landings$value<- factor(all_landings$value,levels=c ("Landings (lbs)", "Total Trips", "CPUE"))
```
```{r echo= FALSE,warning=FALSE, message=FALSE, comment=FALSE, fig.width= 7, fig.height= 8}
ggplot(all_landings, aes(x= as.numeric(Year), y= as.numeric(measurement))) +
geom_line (aes(color= area), size= 1.2) +
geom_point(aes(color= area), size=3) +
xlab("Year") +
ylab("") +
labs(color= "Area") +
scale_linetype_manual(values = c('solid','dotted', 'longdash')) +
scale_color_manual(values= c("#0072B2", "#D55E00", "#CC79A7")) +
scale_x_continuous (breaks= c(startYear:endYear), labels= seq(from = startYear, to = endYear, by = 1)) +
scale_y_continuous(labels = function(x) format(x, scientific = FALSE)) +
theme(legend.position = "top",
axis.text.x = element_text(angle=90, hjust = 0.5),
panel.border = element_rect(colour = "black", fill=NA,size=1, linetype="solid"),
strip.text = element_text(size=15),
text = element_text(size=15),
axis.line = element_line(colour = "black"),
panel.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank()) +
facet_wrap(~value , scales="free_y", ncol= 1)
```
**Figure 5-1.** Figure of oyster landings (lbs), total trips, and cost per unit effort (CPUE) for Apalachicola (blue line), Suwannee Sound (orange), and the State of Florida (pink) for years `r startYear` to `r endYear`.
```{r echo=FALSE, fig.width= 7, fig.height= 8}
all_landings %>%
filter(Year > 2011) %>%
filter(!(area== "State")) %>%
ggplot(aes(x= as.numeric(Year), y= as.numeric(measurement))) +
geom_line (aes(color= area), size= 1.2) +
geom_point(aes(color= area), size=3.5) +
xlab("Year") +
ylab("") +
labs(color= "Area") +
scale_linetype_manual(values = c('solid','dotted', 'longdash')) +
scale_color_manual(values= c("#0072B2", "#D55E00", "#CC79A7")) +
scale_x_continuous (breaks= c(2012:endYear)) +
scale_y_continuous(labels = function(x) format(x, scientific = FALSE)) +
theme(legend.position = "top",
axis.text.x = element_text(angle=90, hjust = 0),
panel.border = element_rect(colour = "black", fill=NA,size=1, linetype="solid"),
strip.text = element_text(size=15),
text = element_text(size=15),
axis.line = element_line(colour = "black"),
panel.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank()) +
facet_wrap(~value , scales="free_y", ncol= 1)
```
**Figure 5-2.** Figure of oyster landings (lbs), total trips, and cost per unit effort (CPUE) for Apalachicola (blue line), Suwannee Sound (orange) for years 2012 to `r endYear`.
```{r, echo=FALSE, fig.width= 7, fig.height= 8}
all_landings %>%
filter(Year> 2014) %>%
filter(!(area== "State")) %>%
ggplot(aes(x= as.numeric(Year), y= as.numeric(measurement))) +
geom_line (aes(color= area), size= 1.2) +
geom_point(aes(color= area), size=3.5) +
xlab("Year") +
ylab("") +
labs(color= "Area") +
scale_linetype_manual(values = c('solid','dotted', 'longdash')) +
scale_y_continuous(labels = function(x) format(x, scientific = FALSE)) +
scale_color_manual(values= c("#0072B2", "#D55E00", "#CC79A7")) +
scale_x_continuous (breaks= c(2015:endYear)) +
#xlim(2015,2020) +
theme(legend.position = "top",
axis.text.x = element_text(angle=90, hjust = 1),
panel.border = element_rect(colour = "black", fill=NA,size=1, linetype="solid"),
strip.text = element_text(size=15),
text = element_text(size=15),
axis.line = element_line(colour = "black"),
panel.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank()) +
facet_wrap(~value , scales="free_y", ncol= 1)
```
**Figure 5-3.** Figure of oyster landings (lbs), total trips, and cost per unit effort (CPUE) for Apalachicola (blue line), Suwannee Sound (orange) for years 2015 to `r endYear`.