Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tedflynn committed Mar 18, 2024
2 parents 7ae54b8 + f7df0e8 commit 5b35a7a
Show file tree
Hide file tree
Showing 55 changed files with 13,011 additions and 7,241 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions Zoop_code/Jesse-zoop-analyses/FASTR_zoop_multivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ source(here("global_ndfa_funcs.R"))
source(here("Water_Quality/global_wq_funcs.R"))

#zooplankton data from Mallory and Nicole (biomass)
zoopNDFAv2<-read.csv("Zoop_code/zoop_NDFA_v2.csv", stringsAsFactors = FALSE)
zoopNDFAv2<-read.csv("zoop_NDFA_v2.csv", stringsAsFactors = FALSE)
#data organization and cleanup
#change to factors and organize sample period levels
zoopNDFAv2$SamplePeriod <- factor(zoopNDFAv2$SamplePeriod,levels = c("Before","During","After"))
Expand Down Expand Up @@ -299,9 +299,9 @@ fig1 <- ggplot(data=zoopNDFA7, aes(y= log10(cpue),
geom_boxplot(size=.2,outlier.size = .5)

fig1 +
labs(title = "Total Zooplankton Abundance by Year",
y = bquote(Log[10]~'Zooplankton Abundance'~(indiv.~L^-1)),
x = "Sampling Region",
labs(title = NULL,
y = bquote(Log[10]~'Zooplankton CPUE'~(indiv.~L^-1)),
x = NULL,
fill = "Pulse Period") +
theme_bw()+
scale_fill_manual(values = c("#4DAF4A",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Zoop_code/ted-zoop-analyses/plots/fig4_zoop_order_by_year.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Zoop_code/ted-zoop-analyses/plots/p_zoop_NMDS_region.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 29 additions & 12 deletions Zoop_code/ted-zoop-analyses/zoop-data-processing-FASTRv2.R
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ p_zoop_NMDS_Region <- ggplot(df_zoop_gen_NMDS, aes(x = NMDS1,
color = Region)) +
geom_point(size = 3) +
stat_ellipse() +
labs(title = "Zooplankton Community Composition") +
labs(title = NULL) +
labs(color = "Region") +
theme_bw() +
scale_color_brewer(palette = "Set1")
Expand All @@ -284,7 +284,7 @@ p_zoop_NMDS_Region +
facet_wrap(Year ~ ., ncol = 3, dir = "h") +
labs(x = NULL,
y = NULL,
title = "Zooplankton Community Comparison (2014-2019)",
title = NULL,
color = "Region") +
theme(axis.text.x=element_blank(),
axis.ticks.x=element_blank(),
Expand All @@ -309,7 +309,7 @@ p_zoop_NMDS_SamplePeriod <- ggplot(df_zoop_gen_NMDS, aes(x = NMDS1,
color = SamplePeriod)) +
geom_point(size = 3) +
stat_ellipse() +
labs(title = "Zooplankton Community Composition") +
labs(title = NULL) +
labs(color = "Sample Period") +
theme_bw() +
scale_color_brewer(palette = "Set1")
Expand All @@ -318,7 +318,7 @@ p_zoop_NMDS_SamplePeriod +
facet_wrap(Year~., ncol = 3, dir = "h") +
labs(x = NULL,
y = NULL,
title = "Zooplankton Community Comparison (2014-2019)",
title = NULL,
color = "Flow Pulse Period") +
theme(axis.text.x=element_blank(),
axis.ticks.x=element_blank(),
Expand All @@ -341,7 +341,7 @@ p_zoop_NMDS_SamplePeriod +
facet_wrap(vars(Year, Region), ncol = 4, dir = "h") +
labs(x = NULL,
y = NULL,
title = "NDFA - Zooplankton Community Comparison (2014-2019)",
title = NULL,
color = "Sample Period") +
theme(axis.text.x=element_blank(),
axis.ticks.x=element_blank(),
Expand Down Expand Up @@ -439,7 +439,7 @@ fig4 <- ggplot(df_zoop, aes(x = SamplePeriod,
fig4 +
labs(x = NULL,
y = bquote('Average Zooplankton CPUE ' ~ ('organisms *'~L^-1)),
title = paste0("Abundance of Zooplankton Orders During Flow Pulses")) +
title = paste0(NULL)) +
theme(panel.background = element_rect(fill = "white", linetype = 0)) +
theme(panel.grid.major.x = element_blank(), panel.grid.minor = element_blank()) +
scale_fill_manual(values = c("#E41A1C",
Expand Down Expand Up @@ -469,25 +469,42 @@ testdata$logCPUEzoop <- log(testdata$CPUEZoop+1)
testplot <- ggplot(testdata, aes(x = SamplePeriod, y = logCPUEzoop, fill = Region))+
geom_boxplot()
testplot+
labs(x = bquote('Flow Pulse Period'),
y = bquote('log CPUE of P. forbesi ' ~ ('organisms *'~L^-1)),
title = paste0("Abundance of P. forbesi by Region and Flow Pulse Period")) +
labs(x = bquote(NULL),
y = expression(paste("Log CPUE of " ,italic(" P. forbesi "), ~ ("organisms *"~L^-1))),
title = paste0(NULL)) +
theme(panel.background = element_rect(fill = "white", linetype = 0)) +
theme(panel.grid.major.x = element_blank(), panel.grid.minor = element_blank()) +
scale_fill_manual(values = c("#E41A1C",
"#377EB8")) +
theme(axis.text.x = element_text(angle = 0, vjust = 0.7))

ggsave(path = output,
filename = paste0("Pforbesi_regfpp.png"),
device = "png",
scale=1.0,
units="in",
height=5,
width=7.5,
dpi="print")
testplot+
facet_wrap(vars(Year), ncol = 3, dir = "h") +
labs(x = bquote('Flow Pulse Period'),
y = bquote('log CPUE of P. forbesi ' ~ ('organisms *'~L^-1)),
title = paste0("Abundance of P. forbesi by Region and Flow Pulse Period")) +
labs(x = bquote(NULL),
y = expression(paste("Log CPUE of " ,italic(" P. forbesi "), ~ ("organisms *"~L^-1))),
title = paste0(NULL)) +
theme(panel.background = element_rect(fill = "white", linetype = 0)) +
theme(panel.grid.major.x = element_blank(), panel.grid.minor = element_blank()) +
scale_fill_manual(values = c("#E41A1C",
"#377EB8")) +
theme(axis.text.x = element_text(angle = 0, vjust = 0.7))

ggsave(path = output,
filename = paste0("Pforbesi_regfpp_facet.png"),
device = "png",
scale=1.0,
units="in",
height=5,
width=7.5,
dpi="print")
#trying geom_jitter (i don't think it's better)
testplot2 <- ggplot(testdata, aes(x = SamplePeriod, y = logCPUEzoop, fill = Region))+
geom_jitter(aes(colour=Region))
Expand Down
Loading

0 comments on commit 5b35a7a

Please sign in to comment.