diff --git a/DESCRIPTION b/DESCRIPTION index 0e4000a..d8b4941 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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: @@ -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 diff --git a/R/catch.R b/R/catch.R index 0142632..a18ce01 100755 --- a/R/catch.R +++ b/R/catch.R @@ -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)), diff --git a/R/pprey.mat.R b/R/pprey.mat.R index b1c11e6..9b7685a 100755 --- a/R/pprey.mat.R +++ b/R/pprey.mat.R @@ -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 @@ -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') @@ -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({ @@ -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. @@ -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){ diff --git a/man/theme_atlantis.Rd b/man/theme_atlantis.Rd index 8440d6f..87da627 100644 --- a/man/theme_atlantis.Rd +++ b/man/theme_atlantis.Rd @@ -19,7 +19,5 @@ Main Atlatnis Theme Main Atlatnis Theme } \author{ -Javier Porobic - Javier Porobic }