Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ReactiveAtlantis
Title: Multiple Reactive HTML tools to help in the calibration of the Atlantis ecosystem model (AEM)
Version: 0.0.2.1
Version: 0.0.2.2
Authors@R: person("Javier", "Porobic", email = "jporobicg@gmail.com", role = c("aut", "cre"))
Description: This package has tools that help in the calibration of an AEM. These tools are reactive HTML pages that help you analyze AEM data outputs and inputs during the calibration process.
Depends:
Expand All @@ -9,5 +9,5 @@ License: GPL-3
Imports: shiny, ncdf4, tidyverse, stringr, data.table, RColorBrewer, Rdpack, reshape2, plotrix, DT, dplyr, ggplot2, plotly, scales, proj4, tidyr, stats, rlang
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.2
RoxygenNote: 7.3.3
RdMacros: Rdpack
4 changes: 2 additions & 2 deletions R/catch.R
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,9 @@ theme_atlantis <- function(){
## color background 2)
panel.background = ggplot2::element_rect(fill = scales::alpha('#fcda96', 0.1)),
## modify grid 3)
panel.grid.major.x = ggplot2::element_line(colour = "#844D14", linetype = 3, size = 0.5),
panel.grid.major.x = ggplot2::element_line(colour = "#844D14", linetype = 3, linewidth = 0.5),
panel.grid.minor.x = ggplot2::element_blank(),
panel.grid.major.y = ggplot2::element_line(colour = "#844D14", linetype = 3, size = 0.5),
panel.grid.major.y = ggplot2::element_line(colour = "#844D14", linetype = 3, linewidth = 0.5),
panel.grid.minor.y = ggplot2::element_blank(),
## modify text, axis and colour 4) and 5)
axis.text = ggplot2::element_text(colour = "#292B15", face = "italic", family = "Times New Roman", size = ggplot2::rel(1.2)),
Expand Down
13 changes: 6 additions & 7 deletions R/pprey.mat.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ feeding.mat <- function(prm.file, grp.file, nc.file, bgm.file, cum.depths, quiet
predator <- gsub(pattern = "[[:digit:]]+", '\\1', c.pred)
a.pred.prey <- as.numeric(unlist(strsplit(c.pred, predator)))
pry.loc <- which(bio.adl[, 1] %in% predator)
if(length(a.pred.prey) == 0 || is.na(a.pred.prey)) a.pred.prey[2] <- 2
if(length(a.pred.prey) == 0 || any(is.na(a.pred.prey))) a.pred.prey[2] <- 2
## Young Predator
if(a.pred.prey[2] == 1){
## Young Prey
Expand Down Expand Up @@ -442,7 +442,7 @@ feeding.mat <- function(prm.file, grp.file, nc.file, bgm.file, cum.depths, quiet
Press_out <- shiny::reactive({
dat.P <- reshape2::melt(rff2(), value.name = 'value')
dat.P[which(dat.P == 0, arr.ind = TRUE)] <- NA
p <- ggplot2::ggplot(data = dat.P, ggplot2::aes(x = .data$Var1, y = .data$Var2, fill = .data$value)) + geom_tile(colour="grey45", size = 0.2)
p <- ggplot2::ggplot(data = dat.P, ggplot2::aes(x = .data$Var1, y = .data$Var2, fill = .data$value)) + geom_tile(colour="grey45", linewidth = 0.2)
p <- p + scale_fill_distiller(palette = "RdPu",, limits=c(0, 100), name = 'Precentage of pressure', na.value = 'white', direction = 1)
p <- p + theme(panel.background = element_blank(), axis.text.x = element_text(angle = 90, hjust = 1)) + labs(x = 'Prey', y = 'Predator') + scale_x_discrete(position = "top")
p <- p + annotate("rect", xmin = linex() -.5, xmax = linex() +.5, ymin = 0, ymax = ncol(rff2()) + 1, alpha = .1, colour = 'goldenrod')
Expand All @@ -467,14 +467,14 @@ feeding.mat <- function(prm.file, grp.file, nc.file, bgm.file, cum.depths, quiet
})
output$plot5 <- shiny::renderPlot({
ggplot2::ggplot(data = b.juv, ggplot2::aes(x = .data$FG, y = log(.data$Biomass), fill=.data$FG)) +
geom_bar(colour="black", stat="identity") +
guides(fill = FALSE)+
geom_bar(colour="#ad2c2c", stat="identity") +
guides(colour = "black")+
xlab("Functional Groups") + ylab("Biomass [MgN] or Density [MgNm-3]")
})
output$plot6 <- shiny::renderPlot({
ggplot2::ggplot(data = b.adl, ggplot2::aes(x = .data$FG, y = log(.data$Biomass), fill=.data$FG)) +
geom_bar(colour="black", stat="identity") +
guides(fill = FALSE)+
guides(colour = "black")+
xlab("Functional Groups") + ylab("Biomass [MgN] or Density [MgNm-3]")
})
output$plot10 <- shiny::renderPlot({
Expand Down Expand Up @@ -550,7 +550,6 @@ Bio.func <- function(nc.file, groups.csv, numlayers){
## ~ Age structured biomass pools and biomass pool ~ ##
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ##
if(groups.csv$numcohorts[code] == 1 || TY[code] %in% special){
browser()
for(coh in 1 : groups.csv$numcohorts[code]){
if(grepl("ice", FG[code])) {
# If group name contains "Ice", the nc file will only contain one value per polygon, instead of values for all depths in the water column.
Expand Down Expand Up @@ -831,7 +830,7 @@ Over.mat.func <- function(Ava.mat, Gape){
a.pred.prey <- as.numeric(unlist(strsplit(c.pred, predator)))
pry.loc <- which(Gape$FG %in% Prey[py])
prd.loc <- which(Gape$FG %in% predator)
if(length(pry.loc) == 0 || is.na(a.pred.prey)){
if (length(pry.loc) == 0 || any(is.na(a.pred.prey))){
Over.mat [pd, py] <- 1
} else {
if(a.pred.prey[1] == 1){
Expand Down
2 changes: 0 additions & 2 deletions man/theme_atlantis.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.