Skip to content

Commit

Permalink
revert package load to library (Require bogs the app down).
Browse files Browse the repository at this point in the history
  • Loading branch information
cmahony committed May 7, 2024
1 parent ad47a96 commit 53b77f9
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions spatial_app/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1602,7 +1595,7 @@ server <- function(input, output, session) {
sep="."
)
},
period,
periods[as.numeric(input$period)],
"png", sep=".")
},

Expand Down

0 comments on commit 53b77f9

Please sign in to comment.