@@ -455,10 +455,10 @@ for(j in seq_along(q.models)){
455455 # monitor=c("Commercial_Pelagic_Fishery"=1))
456456 #Press/Perturbation with decrease forage fish and no monitoring)
457457 press <- press.validate(q.models[[j]],
458- perturb=c("Fishery "=1), monitor=F)
458+ perturb=c("Seals "=1), monitor=F)
459459
460460 ## Function to define the perturbation scenario
461- impact <- press.impact(q.models[[j]],perturb=c("Fishery "=1))
461+ impact <- press.impact(q.models[[j]],perturb=c("Seals "=1))
462462 ## Use 1000 simulations
463463 n.sims <- 1000
464464 results <- 0
@@ -481,8 +481,8 @@ for(j in seq_along(q.models)){
481481
482482 rownames(results) <- levels(q.models[[j]]$From)
483483 colnames(results) <- c('-','0','+')
484- save(results, file=paste0("WSS28","results", j,"Fishery_up ",".RData"))
485- write.csv(results, paste0("WSS28","results", j,"Fishery_up ",".csv"))
484+ save(results, file=paste0("WSS28","results", j,"Seals_up ",".RData"))
485+ write.csv(results, paste0("WSS28","results", j,"Seals_up ",".csv"))
486486
487487
488488
@@ -1131,7 +1131,8 @@ for(j in seq_along(q.models)){
11311131
11321132WSS28.results_ecos<-WSS28.results %>%
11331133 mutate(
1134- Direction=case_match(Direction,"Plus" ~ "plus", "Minus" ~ "minus")
1134+ Direction=case_match(Direction,"Plus" ~ "plus", "Minus" ~ "minus"),
1135+ Group=case_match(Group, "Seals" ~ "Seal", .default=Group)
11351136 ) %>%
11361137 select(!Outside)%>%
11371138 add_column (Model="ecosense", model_links=0) %>%
@@ -1208,11 +1209,7 @@ dat_fishminus<- ecoQNMresults_long %>%
12081209
12091210p_fishminus<- ggplot(dat_fishminus)+
12101211 geom_point(aes(y=node, x=model_ID,cex=value,
1211- pch=sign, color=sign)) +
1212- # pch=sign, color=sign, fill=fill)) +
1213- # scale_color_manual( values=c("lightblue","orangered","grey"))+
1214- # scale_shape_manual(values=c(25,24,22)) +
1215- # scale_fill_manual(values=c("lightblue","orangered","white")) +
1212+ pch=sign, color=sign)) +
12161213
12171214 theme_bw() +
12181215 theme(axis.line = element_line(colour = "black"),
@@ -1225,80 +1222,107 @@ p_fishminus<- ggplot(dat_fishminus)+
12251222 axis.text.x=element_text (angle=-90, hjust=0 ))
12261223
12271224
1225+ dat_sealminus<- ecoQNMresults_long %>%
1226+ filter(scenario=="Seal_minus")
12281227
1229- dat_gb<-subset(dat_long, system=="GB")
1230- dat_gb$node<-factor(dat_gb$node, levels=c( "Seafood","HabitatSeafloorDemersal","Forage Fish", "Groundfish"))
1228+ p_sealminus<- ggplot(dat_sealminus)+
1229+ geom_point(aes(y=node, x=model_ID,cex=value,
1230+ pch=sign, color=sign)) +
12311231
1232- p2<- ggplot(dat_gb)+
1233- geom_point(aes(y=node, x=model,cex=response,
1234- pch=sign, color=sign, fill=fill)) +
1235- scale_color_manual( values=c("lightblue","orangered","grey"))+
1236- scale_shape_manual(values=c(25,24,22)) +
1237- scale_fill_manual(values=c("lightblue","orangered","white")) +
1238- facet_grid(~scen) +
12391232 theme_bw() +
12401233 theme(axis.line = element_line(colour = "black"),
12411234 panel.grid.major = element_blank(),
12421235 panel.grid.minor = element_blank(),
12431236 panel.background = element_blank(),
1244- axis.text.x = element_blank(),
1237+
12451238 axis.title.x=element_blank(),
12461239 axis.title.y=element_blank(),
1247- legend.position = "none" ,
1248- strip.background = element_blank(),
1249- strip.text.x = element_blank()) +
1250- scale_y_discrete(labels=c( "Forage Fish" = "Forage fish",
1251- "HabitatSeafloorDemersal" = "HSD"))
1240+ axis.text.x=element_text (angle=-90, hjust=0 ))
12521241
1242+ dat_sealplus<- ecoQNMresults_long %>%
1243+ filter(scenario=="Seal_plus")
12531244
1245+ p_sealplus<- ggplot(dat_sealplus)+
1246+ geom_point(aes(y=node, x=model_ID,cex=value,
1247+ pch=sign, color=sign)) +
12541248
1255- dat_bar<-subset(dat_long, system=="BAR")
1256- dat_bar$node<-factor(dat_bar$node, levels=c( "Wetlands","Recreation","Habitable Land", "Fish"))
1249+ theme_bw() +
1250+ theme(axis.line = element_line(colour = "black"),
1251+ panel.grid.major = element_blank(),
1252+ panel.grid.minor = element_blank(),
1253+ panel.background = element_blank(),
1254+
1255+ axis.title.x=element_blank(),
1256+ axis.title.y=element_blank(),
1257+ axis.text.x=element_text (angle=-90, hjust=0 ))
12571258
1259+ dat_smallpelagicsminus<- ecoQNMresults_long %>%
1260+ filter(scenario=="Small pelagics_minus")
1261+
1262+ p_smallpelagicsminus<- ggplot(dat_smallpelagicsminus)+
1263+ geom_point(aes(y=node, x=model_ID,cex=value,
1264+ pch=sign, color=sign)) +
12581265
1259- p3<- ggplot(dat_bar)+
1260- geom_point(aes(y=node, x=model,cex=response,
1261- pch=sign, color=sign, fill=fill)) +
1262- scale_color_manual( values=c("lightblue","orangered","grey"))+
1263- scale_shape_manual(values=c(25,24,22)) +
1264- scale_fill_manual(values=c("lightblue","orangered","white")) +
1265- facet_grid(~scen) +
12661266 theme_bw() +
12671267 theme(axis.line = element_line(colour = "black"),
12681268 panel.grid.major = element_blank(),
12691269 panel.grid.minor = element_blank(),
12701270 panel.background = element_blank(),
1271+
1272+ axis.title.x=element_blank(),
12711273 axis.title.y=element_blank(),
1272- legend.position = "none",
1273- strip.background = element_blank(),
1274- strip.text.x = element_blank()) +
1275- scale_x_discrete(labels=c("catqnm" = "QNM", "catbbn" = "BBN",
1276- "catfcm" = "FCM")) +
1277- scale_y_discrete(labels=c( "Habitable Land" = "HL"))
1274+ axis.text.x=element_text (angle=-90, hjust=0 ))
1275+
1276+ dat_smallpelagicsplus<- ecoQNMresults_long %>%
1277+ filter(scenario=="Small pelagics_plus")
12781278
1279+ p_smallpelagicsplus<- ggplot(dat_smallpelagicsplus)+
1280+ geom_point(aes(y=node, x=model_ID,cex=value,
1281+ pch=sign, color=sign)) +
12791282
1280- grid.arrange(p1, p2, p3, ncol=1)
1283+ theme_bw() +
1284+ theme(axis.line = element_line(colour = "black"),
1285+ panel.grid.major = element_blank(),
1286+ panel.grid.minor = element_blank(),
1287+ panel.background = element_blank(),
1288+
1289+ axis.title.x=element_blank(),
1290+ axis.title.y=element_blank(),
1291+ axis.text.x=element_text (angle=-90, hjust=0 ))
12811292
1282- library(gtable)
1283- library(grid )
1293+ dat_phytoplanktonminus<- ecoQNMresults_long %>%
1294+ filter(scenario=="Phytoplankton_minus" )
12841295
1285- g1 <- ggplotGrob(p1)
1286- g2 <- ggplotGrob(p2)
1287- g3 <- ggplotGrob(p3)
1288- g <- rbind(g1,g2, g3, size = "first")
1296+ p_phytoplanktonminus<- ggplot(dat_phytoplanktonminus)+
1297+ geom_point(aes(y=node, x=model_ID,cex=value,
1298+ pch=sign, color=sign)) +
12891299
1290- g$widths <- unit.pmax(g1$widths, g2$widths, g3$widths)
1291- grid.newpage()
1292- grid.draw(g)
1300+ theme_bw() +
1301+ theme(axis.line = element_line(colour = "black"),
1302+ panel.grid.major = element_blank(),
1303+ panel.grid.minor = element_blank(),
1304+ panel.background = element_blank(),
1305+
1306+ axis.title.x=element_blank(),
1307+ axis.title.y=element_blank(),
1308+ axis.text.x=element_text (angle=-90, hjust=0 ))
12931309
1294- #ggsave(filename="core_nodes_REV.pdf", width = 15, height = 15, units = "cm", dpi=300)
1295- #ggsave not working for some reason
1296- grid.newpage()
1310+ dat_phytoplanktonplus<- ecoQNMresults_long %>%
1311+ filter(scenario=="Phytoplankton_plus")
12971312
1298- pdf("core_nodes_REV.pdf", width = 4, height = 5)
1299- grid.draw(g)
1300- dev.off()
1313+ p_phytoplanktonplus<- ggplot(dat_phytoplanktonplus)+
1314+ geom_point(aes(y=node, x=model_ID,cex=value,
1315+ pch=sign, color=sign)) +
13011316
1317+ theme_bw() +
1318+ theme(axis.line = element_line(colour = "black"),
1319+ panel.grid.major = element_blank(),
1320+ panel.grid.minor = element_blank(),
1321+ panel.background = element_blank(),
1322+
1323+ axis.title.x=element_blank(),
1324+ axis.title.y=element_blank(),
1325+ axis.text.x=element_text (angle=-90, hjust=0 ))
13021326
13031327```
13041328
0 commit comments