Skip to content

Commit

Permalink
draw_ply() move
Browse files Browse the repository at this point in the history
  • Loading branch information
stangandaho committed Jan 15, 2024
1 parent 78c48ec commit 7dd2f26
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions inst/nimo/server.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

## SERVER
server <- function(input, output, session) {
src_root <- paste0(system.file("nimo", package = "nimo"), "/src/")#"./inst/nimo/src/"
Expand Down Expand Up @@ -431,9 +430,8 @@ occ_dt <- reactive({
method = c("pearson", th = as.character(input$pearson_threshold)))
cr_df <- colin_var$cor_table # table
enlayer <- colin_var$cor_variables # layer
#corr_matrix <- col_red$cor_table
highly_corr_vars <- find_coor(cr_df, cutoff = input$pearson_threshold, names = T)#find_coor function from src folder
#keep_var <- cr_df[, !colnames(cr_df) %in% highly_corr_vars]
highly_corr_vars <- find_coor(cr_df, cutoff = input$pearson_threshold,
names = T)#find_coor function from inst/nimo/src folder
rm_enlayer <- highly_corr_vars
} else if(input$coli_method == "vif"){
colin_var <- correct_colinvar(env_layer = env_layers(), method = c("vif", th = as.character(input$vif_threshold)))
Expand Down Expand Up @@ -1055,7 +1053,7 @@ observeEvent(input$ensemble,
)

output$selected_mod_lenght <- renderText(
paste("The number of models selected for assemblage:", length(sst()) ))
paste("The number of models selected for ensemble:", length(sst()) ))


ens_fitting <- eventReactive(input$fit_ens, {
Expand Down Expand Up @@ -1445,7 +1443,7 @@ observeEvent(input$species_input, {
gbif_data <- eventReactive(input$load_gbif_data, {
if (!is.null(drawn_poly())) {
list(
inside_drawn_ply()[[1]],
inside_drawn_ply()[[1]], # inside_drawn_ply() from ./inst/nimo/src/handle_sf.R
inside_drawn_ply()[[2]]
)}
else if (input$country_filter != "" & input$use_geom_gbif == FALSE) {
Expand Down Expand Up @@ -1565,12 +1563,6 @@ observe({
})
observeEvent(input$clear_map, {polyg$point <- data.frame(lon = c(), lat = c())})

drawn_poly <- eventReactive(input$acces_gbif_data, {
if (!is.null(polyg$point$lon) & !is.null(polyg$point$lat)) {
sf::st_as_sf(x = polyg$point, coords = c("lon", "lat"), crs = 4326)
}
})

## clear button
observe({
shinyjs::hide("clear_map")
Expand Down

0 comments on commit 7dd2f26

Please sign in to comment.