From 53b77f931b7d749a45caf9012873c2dba872f7f3 Mon Sep 17 00:00:00 2001 From: Mahony Date: Mon, 6 May 2024 19:08:41 -0700 Subject: [PATCH] revert package load to library (Require bogs the app down). --- spatial_app/app.R | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/spatial_app/app.R b/spatial_app/app.R index 2da5f5f..d4b5936 100644 --- a/spatial_app/app.R +++ b/spatial_app/app.R @@ -15,27 +15,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -if (!requireNamespace("Require")) { - install.packages("Require") -} - -Require::Require(c( - "car", - "DT", - "htmlwidgets", - "leaflet", - "leafem", - # "mapview", - "markdown", - "plotrix", - "raster", - "RColorBrewer", - "scales", - "sf", - # "shiny", - "stinepack", # for interpolation splines - "terra" -)) +library(car) +library(DT) +library(htmlwidgets) +library(leaflet) +library(leafem) +library(markdown) +library(plotrix) +library(raster) +library(RColorBrewer) +library(scales) +library(sf) +library(stinepack) +library(terra) # Increase the maximum upload size to 60 MB options(shiny.maxRequestSize = 60*1024^2) @@ -1182,6 +1174,7 @@ server <- function(input, output, session) { is.focalSim <- paste(gcm, substr(run,1,2), sep="_")==sim.focal x2 <- data[c(1, which(identity$GCM==gcm & identity$SSP==scenario & identity$RUN==run)), which(variables==var1)] y2 <- data[c(1, which(identity$GCM==gcm & identity$SSP==scenario & identity$RUN==run)), which(variables==var2)] + if(run=="ensembleMean") points(x2, y2, col=ColScheme.gcms[i], pch=16, cex=0.5) if(length(unique(sign(diff(x2))))==1){ x3 <- if(unique(sign(diff(x2)))==-1) rev(x2) else x2 y3 <- if(unique(sign(diff(x2)))==-1) rev(y2) else y2 @@ -1602,7 +1595,7 @@ server <- function(input, output, session) { sep="." ) }, - period, + periods[as.numeric(input$period)], "png", sep=".") },