library(dplyr)
library(ggplot2)
library(tidyverse)
source(here::here('coord_conversion.R'))
# Pull in map objects (bathymetry, us/canada shapefiles)
load(here::here('nes_map.Rdata'))
# Setting up color palettes
pal.m = hcl.colors(5, palette = 'Dark Mint')
# scales::show_col(pal.m) # view color pallete
pal.f.full = hcl.colors(5, palette = 'BurgYl')
pal.f = pal.f.full[c(1,2,4)] # just playilng with colors bc there are only 3 stages
# scales::show_col(pal.f)
world <- ggplot2::map_data('world')
# Data
# This first data pull has the location information - will merge with data pull
# that also has age information
# -- data w/lat lon
squibs <- read.csv(here::here('data/squibs/2024-11-01_weekly_SQUIBS_pull.csv'))
#squibs <- read.csv(here::here('data/squibs/2024-10-04_weekly_SQUIBS_pull.csv'))
# Convert the lat lons from DDM to DD and add season
squibs <- squibs %>% rename_all(., .funs = tolower)%>%
rename(age.d = 'increment.count.1') %>%
mutate(lat = convertcoord(start_haul_lat),
lon = convertcoord(start_haul_lon),
season = case_when(month %in% c(1,2,3) ~ 'winter',
month %in% c(4,5,6) ~ 'spring',
month %in% c(7,8,9) ~ 'summer',
month %in% c(10,11,12) ~ 'fall'),
month.n = month.name[month],
age.m = round(age.d/30))
df <- squibs
This document serves as an exploration of the SQUIBS age and maturity data. While there is much more that can be done, this document is intended to be an overview of the data available to date for maturity information (May 2023:Oct 2024) and ages estimated via statoliths (May 2023:Dec 2023).
Figure 1. Age frequencies of all aged statoliths to date.The total number of squid aged is 610.
## -- Length freq plot -- ##
# Define category breaks
size_breaks <- c(0,30, 60, 90, 120, 150,180,210,240, 270,300)
# Making a function to bin the catches
label_interval <- function(breaks) {
paste0("(", breaks[1:length(breaks) - 1], "-", breaks[2:length(breaks)], ")")
}
labels = label_interval(size_breaks)
tab = table(cut(df$age.d,
breaks = size_breaks,
labels = label_interval(size_breaks)))
tab %>%
as.data.frame() %>%
rename(age = Var1, n = Freq) %>%
ggplot2::ggplot(data=., aes(x=age, y=n)) +
geom_bar(stat="identity", col = 'black', fill = 'grey48') +
labs(x='Age Bins (days)') +
theme_bw() +
labs(x='Age Bins (days)', fill= 'Sex', y = 'Frequency') +
theme(legend.background = element_rect(linetype="solid",
colour ="grey20")) +
theme(axis.text = element_text(size = 13),
axis.title = element_text(size = 13),
axis.ticks.length = unit(-1.4, "mm"))
# save image
#ggsave(path = here::here('figures'),'squibs_age_frqv2.jpg',
# width = 10, height = 8, units = "in", dpi = 300)
Figure 2. Distributions of maturity stages for each sex across seasons. Females are indicated by burgundy, males are indicated by green.The seasons are as follows Winter (Jan, Feb, Mar), Spring (Apr, May, June), Summer (Jul, Aug, Sept), Fall (Oct, Nov, Dec).
ggplot(df %>% filter(sex %in% c('F','M')), aes(x=sex, y=maturity_stage, fill = sex)) +
geom_violin() +
labs(fill = 'Sex', y = 'Maturity Stage') +
theme_bw() +
scale_fill_manual(values=c(pal.f[2],pal.m[3]))+
facet_wrap(~factor(season, c('winter', 'spring', 'summer', 'fall')))
Figure 3. Frequency of ages by season for males and females. Age frequencies of squid by sex and season of catch. The season refers to the season in which the squid was caught, the individual ages are grouped into 30 day bins. Females are indicated by burgundy, males are indicated by green and indeterminate squid are indicated by yellow.
# Create age bins
# Define category breaks
size_breaks <- c(0,30, 60, 90, 120, 150,180,210,240, 270,300)
# Making a function to bin the catches
label_interval <- function(breaks) {
paste0("(", breaks[1:length(breaks) - 1], "-", breaks[2:length(breaks)], ")")
}
labels = label_interval(size_breaks)
# Plot age as function of sex only
tab = table(cut(df$age.d,
breaks = size_breaks,
labels = label_interval(size_breaks)),
df$sex,
df$season)%>%
as.data.frame()
f_range <- range(tab$n)
f_range_breaks <- pretty(f_range, n = 7)
tab %>%
rename(age =Var1, sex = Var2, season = Var3, n = Freq) %>%
mutate(
n = case_when(
sex == 'F' ~ -n,
TRUE ~ n
)
) %>%
filter(sex != 'H') %>%
ggplot(.,
aes(x = n,
y = age,
fill = sex)) +
geom_col(color="black")+
labs(x = 'Number of squid', y = 'Age (days)', fill = 'Sex') +
facet_wrap(~season, ncol = 1) +
scale_x_continuous(breaks = f_range_breaks,
labels = abs(f_range_breaks))+
scale_fill_manual(values=c(pal.f[2],"#E69F00",pal.m[3]))+
theme_classic()
Figure 4. Frequency of ages by maturity stage for males and females.
# Plot age as function of sex and maturity stage
tab = table(cut(df$age.d,
breaks = size_breaks,
labels = label_interval(size_breaks)),
df$sex,
df$maturity_stage) %>%
as.data.frame() %>%
rename(age =Var1, sex = Var2, mat = Var3, n = Freq) %>%
mutate(
n = case_when(
sex == 'F' ~ -n,
TRUE ~ n
)
)
# making x-axis labels easier to read
f_range <- range(tab$n)
f_range_breaks <- pretty(f_range, n = 7)
tab %>%
filter(sex != 'H') %>%
ggplot(.,
aes(x = n,
y = age,
fill = sex)) +
geom_col(color="black")+
labs(x = 'Number of squid', y = 'Age (days)', fill = 'Sex') +
facet_wrap(~mat, ncol = 1) +
scale_x_continuous(breaks = f_range_breaks,
labels = abs(f_range_breaks))+
scale_fill_manual(values=c(pal.f[2],"#E69F00",pal.m[3]))+
theme_classic()
Figure 5. Age of squid (months old) by month in which squid were caught, indicated by the color of the bar.
# By Sex
labels = c('1', '2', '3', '4', '5', '6','7','8','9', '10')
bold_pal <- rcartocolor::carto_pal(12, 'Bold')
table(cut(df$age.d,
breaks = size_breaks,
labels = labels),
df$sex,
df$month.n) %>%
as.data.frame() %>%
filter(Var2 %in% c('F','M')) %>%
ggplot2::ggplot(data=., aes(x=Var1, y=Freq, fill = Var3)) +
geom_bar(stat="identity", col = 'black') +
labs(x='Age Bins (Months Old)', fill= 'Month Landed', y = 'Frequency') +
theme_classic() +
facet_wrap(~ Var2, nrow = 2) +
scale_fill_manual(values = bold_pal, labels = c('January', 'February', 'March', 'April',
'May', 'June', 'July', 'August', 'September',
'October', 'November', 'December'))
Figure 6.
ggplot(df, aes(x=factor(month), y=age.d)) +
geom_boxplot() +
geom_jitter(color="grey", size=0.7, alpha=0.5) +
labs(y = 'Age (days)', x = 'Month caught') +
theme_bw()
Analysis of estimated birth weeks: In the following figures, birth week is calculated as a function of age at capture and then plotted by frequency of squid in sample. For reference, a birth week of 1 represents the first week of 2023, which was January 2-8, 2023. Negative weeks are the weeks of the previous year.
Figure 1. Birth week frequencies of aged squid by sex. Females are indicated in burgundy, males indicated by green and indeterminate squid are yellow.
# Analysis of estimated birth weeks
# Compute birth week as function of age at capture
df$birth.week <- round(df$week-df$age.d/7)
df$age.w <- df$age.d/7
# Plot
table(round(df$birth.week),
df$sex) %>%
as.data.frame() %>%
filter(Var2 != 'H') %>%
ggplot2::ggplot(data=., aes(x=Var1, y=Freq, fill = Var2)) +
geom_bar(stat="identity", col = 'black') +
scale_fill_manual(values=c(pal.f[2],"#E69F00",pal.m[3]))+
labs(x='Birth week', fill= 'Sex', y = 'Frequency') +
theme_classic()
#
Figure 2. Birth week frequencies of aged squid by month landed. The color of the bar represents the month in which the squid were caught, whereas the birth week refers to the estimated week of the year in which the squid hatched.
# Plot Month
#scales::show_col(bold_pal)
table(round(df$birth.week),
df$month.n) %>%
as.data.frame() %>%
ggplot2::ggplot(data=., aes(x=Var1, y=Freq, fill = Var2)) +
geom_bar(stat="identity", col = 'black') +
labs(x='Birth week', fill= 'Month Landed', y = 'Frequency') +
theme_classic() +
scale_fill_manual(values = bold_pal, labels = c('January', 'February', 'March', 'April',
'May', 'June', 'July', 'August', 'September',
'October', 'November', 'December'))
Figure 2. Birth week frequencies of aged squid by month landed and sex. The top panel shows only aged females (F) and the bottom panel is the aged males (M). As above, the color of the bar represents the month in which the squid were caught, whereas the birth week refers to the estimated week of the year in which the squid hatched.
# By Sex
table(round(df$birth.week),
df$sex,
df$month.n) %>%
as.data.frame() %>%
filter(Var2 %in% c('F','M')) %>%
ggplot2::ggplot(data=., aes(x=Var1, y=Freq, fill = Var3)) +
geom_bar(stat="identity", col = 'black') +
labs(x='Birth week', fill= 'Month Landed', y = 'Frequency') +
theme_classic() +
facet_wrap(~ Var2, nrow = 2) +
scale_fill_manual(values = bold_pal, labels = c('January', 'February', 'March', 'April',
'May', 'June', 'July', 'August', 'September',
'October', 'November', 'December'))
Figure 3. Distributions of ages by month landed. The color represents the month in which aged squid were caught.
ggplot(df %>% filter(!is.na(birth.week)),
aes(x=factor(month), y=birth.week, fill = factor(month))) +
geom_violin() +
#geom_jitter(color="grey", size=0.7, alpha=0.5) +
labs(y = 'Birth Week', x = 'Month caught', fill = 'Month Caught') +
scale_fill_manual(values = bold_pal[c(4:12)], labels = c('April',
'May', 'June', 'July',
'August', 'September',
'October', 'November',
'December')) +
theme_bw()
# Figure 4. Weight vs age curve. Contour plot for weight, with growth trajectories
# for 20th and 90th percentile of weight sample in initial week
library(contourPlot)
library(TAM)
library(Hmisc)
library(akima)
# Using weight data:
table(round(df$birth.week),
df$sex,
df$month.n) %>%
as.data.frame()
df2 <- df %>%
filter(age.d != 'NA') %>%
group_by(year, week, age.d) %>% # May want to include stat_area for future analyses?
# mutate(weight = round(BODYWT)) %>%
count(ow)
df2 <- df2 %>%
rename(freq = n)
# contour plots for Weight
nx<-sum(range(df2$week))
range(df2$week)
range(df2$ow)
nx<-32 # number of weeks
ny<-50 #
# year.seq<-c(min(bwts$year):max(bwts$year)), this avoids 'magic numbers' but
# since there are gaps in the data it has to be as below
# range(df$BODYWT)
# range(bwts$BODYWT)
yy<-interp(df2$week,
df2$ow,
df2$n,
xo=seq(17,49, length=nx),
yo=seq(0,500,length=ny),
nx=nx, ny=ny, linear=FALSE,extrap=FALSE, duplicate ="mean")
image(yy, main=paste("Weight prediction surface, year= ",2023),
xlab="Week of Year", ylab="Weight (g)")
contour(yy,add=TRUE)
# find first week greater than or equal to 20.
min.wk <- df2$week[which(df2$week>=20)[1]]
wgt.est.quantiles<-wtd.quantile(df$ow[df$year==2023 & df$week==min.wk],
w=df$n[df$year== 2023 & df$week==min.wk],
probs=c(0.05,0.1,0.9))
yy<-interp(df2$week,
df2$ow,
df2$n,
xo=seq(17,49, length=nx),
yo=seq(0,350,length=ny),
nx=nx, ny=ny, linear=FALSE,extrap=FALSE, duplicate ="mean")
image(yy, main=paste("Weight prediction surface, year= ",2023),
xlab="Week of Year", ylab="Weight (g)")
contour(yy,add=TRUE)
# find first week greater than or equal to 20.
min.wk <- df2$week[which(df2$week>=20)[1]]
wgt.est.quantiles<-wtd.quantile(df$ow[df$year==2023 & df$week==min.wk],
w=df$n[df$year== 2023 & df$week==min.wk],
probs=c(0.05,0.1,0.9))
Proportion of Longfin at a given maturity stage by location. Each pie chart marks the location associated with an individual tally number, or sampling event. The maturity stages separated by sex to limit overlapping points on the maps. A given month may have multiple maps in order increase clarity and reduce overlap.
# Sets up scatterpie
df.pie <- df %>% dplyr::select(tally_no, season, month, sex,
maturity_stage, age.d, lat, lon) %>%
group_by(tally_no,lat, lon, month, sex, maturity_stage) %>%
tally() %>%
mutate(prop = n / sum(n),
labels = scales::percent(prop))
df.pie.w <- df.pie %>% tidyr::pivot_wider(names_from = maturity_stage,
values_from = prop)
# df.pie.w <- df.pie.w[,-13] # remove NA column
df.pie.w <- df.pie.w[,-9] # remove NA column
df.pie.w8 <- df.pie.w %>% filter(!is.na(lon)) %>% # replace NAs in location
mutate_at(c(8:12), ~replace(., is.na(.), 0))
# replace NAs in maturity stage with 0.00 for plotting
p <- ggplot(data = world, aes(x=long, y=lat, group=group)) +
geom_polygon(fill = "darkseagreen", color = "black") +
coord_quickmap(xlim = c(-76,-70), ylim = c(37, 41)) +
ylab("Latitude") +
xlab("Longitude") +
theme(
panel.background = element_rect(fill = "lightsteelblue2"),
panel.grid.minor = element_blank(),
panel.grid.major = element_line(colour = "grey90", size = 0.5),
legend.position = "top")
## January
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 1 & sex =='M'),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 15) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'January - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 1 & sex =='F'),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 15) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'January - Females',
fill = 'Maturity Stage')
## February
p <- ggplot(data = world, aes(x=long, y=lat, group=group)) +
geom_polygon(fill = "darkseagreen", color = "black") +
coord_quickmap(xlim = c(-76,-70), ylim = c(37, 41)) +
ylab("Latitude") +
xlab("Longitude") +
theme(
panel.background = element_rect(fill = "lightsteelblue2"),
panel.grid.minor = element_blank(),
panel.grid.major = element_line(colour = "grey90", size = 0.5),
legend.position = "top")
## Creating two seperate plots bc samples overlap in space and cannot see
## each pie chart clearly
# unique(df.pie.w8$tally_no)
# [1] "N12_202402020958" "N12_202402220919" "N12_202402070948" "N12_202402141137"
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 2 & sex =='M'& tally_no %in% c('N12_202402070948','N12_202402020958')),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 7) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'February - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 2 & sex =='M'& tally_no %in% c('N12_202402220919', 'N12_202402141137')),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 7) +
scale_fill_manual(values = rev(pal.m[1:4]),
na.value = NA, na.translate=FALSE) +
labs(title = 'February - Males',
fill = 'Maturity Stage')
### seperate by tally_no so dont overlap
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 2 & sex =='F'& tally_no %in% c('N12_202402070948','N12_202402020958')),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 7) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'February - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 2 & sex =='F'& tally_no %in% c('N12_202402220919', 'N12_202402141137')),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 7) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'February - Males',
fill = 'Maturity Stage')
## March
# unique(df.pie.w8 %>% filter(month == 3 & sex =='M') %>%
# dplyr::select(tally_no))
# N12_202403071134,N12_202403181018, N12_202403210843
p <- ggplot(data = world, aes(x=long, y=lat, group=group)) +
geom_polygon(fill = "darkseagreen", color = "black") +
coord_quickmap(xlim = c(-76,-69), ylim = c(37, 41)) +
ylab("Latitude") +
xlab("Longitude") +
theme(
panel.background = element_rect(fill = "lightsteelblue2"),
panel.grid.minor = element_blank(),
panel.grid.major = element_line(colour = "grey90", size = 0.5),
legend.position = "top")
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 3 & sex =='M' &
tally_no %in% c('N12_202403071134',
'N12_202403181018')),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 15) +
scale_fill_manual(values = rev(pal.m[1:4]),
na.value = NA, na.translate=FALSE) +
labs(title = 'March - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 3 & sex =='M'),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 15) +
scale_fill_manual(values = rev(pal.m[1:4]),
na.value = NA, na.translate=FALSE) +
labs(title = 'March - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 3 & sex =='F' &
tally_no %in% c('N12_202403071134',
'N12_202403181018')),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 15) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'March - Females',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 3 & sex =='F'),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 15) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'March - Females',
fill = 'Maturity Stage')
p <- ggplot(data = world, aes(x=long, y=lat, group=group)) +
geom_polygon(fill = "darkseagreen", color = "black") +
coord_quickmap(xlim = c(-76,-69), ylim = c(37, 41)) +
ylab("Latitude") +
xlab("Longitude") +
theme(
panel.background = element_rect(fill = "lightsteelblue2"),
panel.grid.minor = element_blank(),
panel.grid.major = element_line(colour = "grey90", size = 0.5),
legend.position = "top")
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 4 & sex =='M'),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 15) +
scale_fill_manual(values = rev(pal.m[1:4]),
na.value = NA, na.translate=FALSE) +
labs(title = 'April - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 4 & sex =='F'),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 15) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'April - Females',
fill = 'Maturity Stage')
tals = unique(df.pie.w8 %>% filter(month == 5 & sex =='M') %>%
dplyr::select(tally_no))
tals <- tals$tally_no
p <- ggplot(data = world, aes(x=long, y=lat, group=group)) +
geom_polygon(fill = "darkseagreen", color = "black") +
coord_quickmap(xlim = c(-75,-69), ylim = c(39.5, 43)) +
ylab("Latitude") +
xlab("Longitude") +
theme(
panel.background = element_rect(fill = "lightsteelblue2"),
panel.grid.minor = element_blank(),
panel.grid.major = element_line(colour = "grey90", size = 0.5),
legend.position = "top")
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 5 & sex =='M' & tally_no %in% tals[c(1:5)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 2) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'May - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 5 & sex =='M' & tally_no %in% tals[c(6:11)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 2) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'May - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 5 & sex =='M' & tally_no %in% tals[c(12:16)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 3.5) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'May - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 5 & sex =='F'& tally_no %in% tals[c(1:5)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 1.5) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'May - Females',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 5 & sex =='F'& tally_no %in% tals[c(6:11)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 2) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'May - Females',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 5 & sex =='F'& tally_no %in% tals[c(12:16)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 4) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'May - Females',
fill = 'Maturity Stage')
p <- ggplot(data = world, aes(x=long, y=lat, group=group)) +
geom_polygon(fill = "darkseagreen", color = "black") +
coord_quickmap(xlim = c(-76,-69), ylim = c(37, 43)) +
ylab("Latitude") +
xlab("Longitude") +
theme(
panel.background = element_rect(fill = "lightsteelblue2"),
panel.grid.minor = element_blank(),
panel.grid.major = element_line(colour = "grey90", size = 0.5),
legend.position = "top")
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 6 & sex =='M'),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'June - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 6 & sex =='F'),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'June - Females',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 7 & sex =='M'),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'July - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 7 & sex =='F'),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'July - Females',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 8 & sex =='M'),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'August - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 8 & sex =='F'),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'August - Females',
fill = 'Maturity Stage')
tals = unique(df.pie.w8 %>% filter(month == 9 & sex =='M') %>%
dplyr::select(tally_no))
tals <- tals$tally_no
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 9 & sex =='M'&
tally_no %in% tals[c(1:5)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'September - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 9 & sex =='M'&
tally_no %in% tals[c(6:11)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = .1) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'September - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 9 & sex =='M'&
tally_no %in% tals[c(12:16)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'September - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 9 & sex =='F'&
tally_no %in% tals[c(1:5)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'September - Females',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 9 & sex =='F'&
tally_no %in% tals[c(6:11)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = .1) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'September - Females',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 9 & sex =='F'&
tally_no %in% tals[c(12:16)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'September - Females',
fill = 'Maturity Stage')
tals = unique(df.pie.w8 %>% filter(month == 10 & sex =='M') %>%
dplyr::select(tally_no))
tals <- tals$tally_no
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 10 & sex =='M'&
tally_no %in% tals[c(1,3,5,7,9)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 6) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'October - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 10 & sex =='M'&
tally_no %in% tals[c(2,4,10)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'October - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 10 & sex =='M'&
tally_no %in% tals[c(6,8)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 18) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'October - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 10 & sex =='F'&
tally_no %in% tals[c(1,3,5,7,9)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 6) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'October - Females',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 10 & sex =='F'&
tally_no %in% tals[c(2,4,10)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'October - Females',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 10 & sex =='F'&
tally_no %in% tals[c(6,8)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 18) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'October - Females',
fill = 'Maturity Stage')
tals = unique(df.pie.w8 %>% filter(month == 11 & sex =='M') %>%
dplyr::select(tally_no))
tals <- tals$tally_no
p <- ggplot(data = world, aes(x=long, y=lat, group=group)) +
geom_polygon(fill = "darkseagreen", color = "black") +
coord_quickmap(xlim = c(-76,-69), ylim = c(37, 43)) +
ylab("Latitude") +
xlab("Longitude") +
theme(
panel.background = element_rect(fill = "lightsteelblue2"),
panel.grid.minor = element_blank(),
panel.grid.major = element_line(colour = "grey90", size = 0.5),
legend.position = "top")
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 11 & sex =='M'&
tally_no %in% tals[c(1,5,6)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'November - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 11 & sex =='M'&
tally_no %in% tals[c(2,3)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 7) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'November - Males',
fill = 'Maturity Stage')
p <- ggplot(data = world, aes(x=long, y=lat, group=group)) +
geom_polygon(fill = "darkseagreen", color = "black") +
coord_quickmap(xlim = c(-76,-69), ylim = c(39, 43)) +
ylab("Latitude") +
xlab("Longitude") +
theme(
panel.background = element_rect(fill = "lightsteelblue2"),
panel.grid.minor = element_blank(),
panel.grid.major = element_line(colour = "grey90", size = 0.5),
legend.position = "top")
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 11 & sex =='M'&
tally_no %in% tals[c(4,6)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'November - Males',
fill = 'Maturity Stage')
p <- ggplot(data = world, aes(x=long, y=lat, group=group)) +
geom_polygon(fill = "darkseagreen", color = "black") +
coord_quickmap(xlim = c(-76,-69), ylim = c(37, 43)) +
ylab("Latitude") +
xlab("Longitude") +
theme(
panel.background = element_rect(fill = "lightsteelblue2"),
panel.grid.minor = element_blank(),
panel.grid.major = element_line(colour = "grey90", size = 0.5),
legend.position = "top")
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 11 & sex =='F'&
tally_no %in% tals[c(1,5,6)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'November - Females',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 11 & sex =='F'&
tally_no %in% tals[c(2,3)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 7) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'November - Females',
fill = 'Maturity Stage')
p <- ggplot(data = world, aes(x=long, y=lat, group=group)) +
geom_polygon(fill = "darkseagreen", color = "black") +
coord_quickmap(xlim = c(-76,-69), ylim = c(39, 43)) +
ylab("Latitude") +
xlab("Longitude") +
theme(
panel.background = element_rect(fill = "lightsteelblue2"),
panel.grid.minor = element_blank(),
panel.grid.major = element_line(colour = "grey90", size = 0.5),
legend.position = "top")
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 11 & sex =='F'&
tally_no %in% tals[c(4,6)]),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'November - Females',
fill = 'Maturity Stage')
p <- ggplot(data = world, aes(x=long, y=lat, group=group)) +
geom_polygon(fill = "darkseagreen", color = "black") +
coord_quickmap(xlim = c(-76,-69), ylim = c(38, 43)) +
ylab("Latitude") +
xlab("Longitude") +
theme(
panel.background = element_rect(fill = "lightsteelblue2"),
panel.grid.minor = element_blank(),
panel.grid.major = element_line(colour = "grey90", size = 0.5),
legend.position = "top")
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 12 & sex =='M'),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.m),
na.value = NA, na.translate=FALSE) +
labs(title = 'December - Males',
fill = 'Maturity Stage')
p +
scatterpie::geom_scatterpie(data = df.pie.w8 %>%
filter(month == 12 & sex =='F'),
aes(x=lon, y=lat, group=factor(tally_no)),
cols=c('0','1','2','3','4'),pie_scale = 5) +
scale_fill_manual(values = rev(pal.f),
na.value = NA, na.translate=FALSE) +
labs(title = 'December - Females',
fill = 'Maturity Stage')