-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathEcoNicheS.R
4949 lines (4085 loc) · 224 KB
/
EcoNicheS.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#This is a Shiny web application. You can run the application by clicking the 'Run App' button above.
#Find out more about building applications with Shiny here:
#http://shiny.rstudio.com/
options(shiny.maxRequestSize = 80000*1024^2)
library(shiny)
library(terra)
library(usdm)
library(ENMTools)
library(biomod2)
library(RColorBrewer)
library(dismo)
library(tiff)
library(rJava)
library(tidyterra)
library(shinydashboard)
library(pROC)
library(R.utils)
library(countrycode)
library(CoordinateCleaner)
library(dplyr)
library(ggplot2)
library(rgbif)
library(sf)
library(rnaturalearthdata)
library(spThin)
library(shinyjs)
library(leaflet)
library(DT)
library(shinyBS)
library(prettymapr)
library(ntbox)
library(gt)
library(tidyverse)
library(gtExtras)
library(shinyBS)
library(leaflet.extras)
library(geodata)
library(viridis)
library(ggthemes)
library(sp)
library(earth)
library(xgboost)
library(gdistance)
library(foreach)
library(doParallel)
library(raster)
library(progress)
library(readr)
library(MIAmaxent)
library(shiny)
library(terra)
library(sf)
library(gdistance)
library(viridis)
# Definir UI de la aplicación principal
ui <- dashboardPage(
dashboardHeader(title = 'EcoNicheS V. 1.1.0',
tags$li(class = "dropdown",
tags$style(HTML("
.skin-pink .main-header {
background-color: #FFC0CB;
}
"))
),
tags$li(
class = "dropdown",
a(href = "https://github.com/armandosunny/EcoNicheS",
icon("github"),
"USER MANUAL"
)
)
), #aqui le moví
dashboardSidebar(
sidebarMenu(
menuItem(text = HTML("<i class='fa-solid fa-frog'></i> EcoNicheS"), tabName = "tab1"),
menuItem(text = HTML("<i class='fa-solid fa-cloud-sun'></i> Environmental Data"), tabName = "tab2"),
menuItem(text = HTML("<i class='fas fa-globe'></i> Occurrence processing"), tabName = "tab3",
menuSubItem("Get and clean GBIF data", tabName = "subtab1"),
menuSubItem("Clean my own database", tabName = "subtab2")),
menuItem(text = HTML("<i class='fas fa-map'></i> Load and Plot Maps"), tabName = "tab4"),
menuItem(text = HTML("<i class='fa-solid fa-clipboard-check'></i> Correlation layers"), tabName = "tab5"),
menuItem(text = HTML("<i class='fas fa-dot-circle'></i> Points and pseudoabsences"), tabName = "tab6"),
menuItem(text = HTML("<i class='fas fa-cogs'></i> biomod2"), tabName = "tab7"),
menuItem(text = HTML("<i class='fas fa-map'></i> Load and Plot Maps"), tabName = "tab8"),
menuItem(text = HTML("<i class='fas fa-chart-bar'></i> Partial ROC Analysis"), tabName = "tab9"),
menuItem(text = HTML("<i class='fa-solid fa-mountain-city'></i> Remove urbanization"), tabName = "tab10"),
menuItem(text = HTML("<i class='fa-solid fa-mountain-sun'></i> Calculate area"), tabName = "tab11"),
menuItem(text = HTML("<i class='fas fa-chart-line'></i> Gains and Losses Plot"), tabName = "tab12"),
menuItem(text = HTML("<i class='fa-solid fa-mountain'></i> ENMTools"), tabName = "tab13"),
menuItem(text = HTML("<i class='fa-solid fa-route'></i> Functional Connectivity"), tabName = "tabC",
menuSubItem("Map Inverter", tabName = "invert_raster"),
menuSubItem("Connectivity Circuit theory", tabName = "tab14"),
menuSubItem("LCP Corridors", tabName = "lcp_analysis"))
)
),
dashboardBody(
tags$style(HTML("
.content-wrapper {
background-color: white;
}
")),
useShinyjs(),
tabItems(
###################################################################################
tabItem(tabName = "tab1",
fluidPage(
##############
tags$head(
tags$script('
$(document).on("shiny:connected", function() {
$("#limit_occ").on("change", function() {
if ($(this).val() === "") {
$(this).val(1000);
}
});
});
')
),
tags$head(
tags$script('
$(document).on("shiny:connected", function() {
$("#km").on("change", function() {
if ($(this).val() === "") {
$(this).val(100);
}
});
});
')
),
tags$head(
tags$script('
$(document).on("shiny:connected", function() {
$("#Year_Y").on("change", function() {
if ($(this).val() === "") {
$(this).val(2000);
}
});
});
')
),
tags$head(
tags$script('
$(document).on("shiny:connected", function() {
$("#study_area").on("change", function() {
if ($(this).val() === "") {
$(this).val(40);
}
});
});
')
),
tags$head(
tags$script('
$(document).on("shiny:connected", function() {
$("#km_redonda").on("change", function() {
if ($(this).val() === "") {
$(this).val(1);
}
});
});
')
),
tags$head(
tags$script('
$(document).on("shiny:connected", function() {
$("#dataSplit").on("change", function() {
if ($(this).val() === "") {
$(this).val(80);
}
});
});
')
),
tags$head(
tags$script('
$(document).on("shiny:connected", function() {
$("#dataRep").on("change", function() {
if ($(this).val() === "") {
$(this).val(10);
}
});
});
')
),
tags$head(
tags$script('
$(document).on("shiny:connected", function() {
$("#iter").on("change", function() {
if ($(this).val() === "") {
$(this).val(500);
}
});
});
')
),
tags$head(
tags$script('
$(document).on("shiny:connected", function() {
$("#omission").on("change", function() {
if ($(this).val() === "") {
$(this).val(0.1);
}
});
});
')
),
tags$head(
tags$script('
$(document).on("shiny:connected", function() {
$("#randper").on("change", function() {
if ($(this).val() === "") {
$(this).val(50);
}
});
});
')
),
tags$head(
tags$script('
$(document).on("shiny:connected", function() {
$("#umbralSuitability").on("change", function() {
if ($(this).val() === "") {
$(this).val(0.7);
}
});
});
')
),
### tooltip
tags$head(
tags$link(rel = "stylesheet", href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css")
),
tags$style(HTML("
.box-title {
display: flex;
align-items: center;
}
.fa-question-circle {
margin-left: 5px;
color: #337ab7;
cursor: help;
}
")),
##cosos
h1("Welcome to EcoNicheS!", style = "font-size: 48px; text-align: center; font-weight: bold; font-family: Arial;"),
img(src = "https://armandosunny.weebly.com/uploads/9/8/0/6/98067990/published/logo-shiny2.png?1721439587", height = "250px", style = "display: block; margin: 0 auto;"),
p("Thanks for using our app! We hope you enjoy your experience.", style = "font-size: 36px; text-align: center;font-family: Arial;"),
p("Please cite as:", style = "font-size: 24px; text-align: center;font-weight: bold; font-family: Arial;"),
p("Marmolejo C, Bolom-Huet R, López-Vidal R, Angela P. Cuervo-Robayo, Sunny A (2025). EcoNicheS V.1.1.0: enhancing ecological niche modeling, niche overlap and connectivity analysis using shiny dashboard and R Package. GitHub. https://github.com/armandosunny/EcoNicheS", style = "font-size: 16px; text-align: center;font-family: Arial;")
## creo que estos parentesis de abajo son los que cierran el tab
)
),
#############3333
tabItem(tabName = "tab2",
fluidPage(
titlePanel("Environmental Data"),
column(width = 4,
box(
title = "Environmental variables",
width = NULL,
radioButtons("options_env_mode", div("Select a work method", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Choose a method to download WorldClim data for the geographic area of interest or select the last option to provide your own data.")), choices = list("Worldclim Global" = 1, "Worldclim by Country" = 2, "Interactive map" = 3, "Use my own files" = 4), selected = 1),
conditionalPanel(
condition = "input.options_env_mode == 2",
textInput("country_env", div("Country of interest", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Only names in English, written with upper or lower case, are accepted.")))
),
conditionalPanel(
condition = "input.options_env_mode == 1 || input.options_env_mode == 2 || input.options_env_mode == 3",
selectInput("varclim_options", div("Select environmental variables", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "These are the WorldClim monthly average climate data. Please refer to the user manual to see its description and units.")),
choices = list("tmin", "tmax", "tavg", "prec", "wind", "vapr", "bio"), multiple=FALSE),
radioButtons("resoltion_env", div("Spatial Resolution (minutes of a degree)", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Please refer to the user manual to see its description.")),
choices = list("10" = 1, "5" = 2, "2.5" = 3, "0.5" = 4), selected = 1))
), #box
box(
title = div("Edition and storage", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "You can crop the area contained in your environmental files or work with the files without editing them.")),
width = NULL,
conditionalPanel(
condition = "input.options_env_mode == 1",
radioButtons("options_crop_global", div("Select an editing/cropping method", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Using longitude and latitude requires that you know their maximum values or values within the geographic area.")),
choices = list("Get the data without editing" = 1, "Use longitude and latitude" = 2), selected = 1)),
conditionalPanel(
condition = "input.options_env_mode == 2",
radioButtons("options_crop", div("Select an editing/cropping method", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Using longitude and latitude requires that you know their maximum values or values within the geographic area. The mask file and shape files are created with other apps. Remember that to crop with a shapefile you need to upload all the related files, even if they have different extensions.")),
choices = list("Get the data without editing" = 1, "Use longitude and latitude" = 2, "Use a mask(.asc)" = 3), selected = 1)),
conditionalPanel(
condition = "input.options_env_mode == 4",
radioButtons("options_crop_myown", div("Select an editing/cropping method", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Remember that to crop with a shapefile you need to upload all the related files, even if they have different extensions.")),
choices = list("Use a mask" = 1, "Use shape files" = 2), selected = 1)),
conditionalPanel(
condition = "input.options_crop == 2 && input.options_env_mode == 2|| input.options_crop_global == 2 && input.options_env_mode == 1",
numericInput("xmin", "Minimum longitude (xmin, west)", value =-10),
numericInput("xmax", "Maximum longitude (xmax, east)", value =17),
numericInput("ymin", "Minimum latitude (ymin, south)", value =39),
numericInput("ymax", "Maximum latitude (ymax, north)", value =48)
),
conditionalPanel(
condition = "input.options_env_mode == 1 && input.options_crop_global == 1 || input.options_env_mode == 2 && input.options_crop == 1",
radioButtons("save_data", div("Data saving", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "This option will automatically save the downloaded layers in .asc format along with their complementary files to your working directory. You can also choose not to save the data if you are just exploring your data or the options that EcoNicheS offers.")),
choices = list("Save layers" = 1, "Do not save" = 2), selected = 1)),
conditionalPanel(
condition = "input.options_env_mode == 1 && input.options_crop_global == 2 || input.options_env_mode == 2 && input.options_crop == 2",
radioButtons("save_data_env", div("Data saving", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "This option will automatically save the downloaded layers in .asc format along with their complementary files to your working directory. You can also choose to save only the edited layers or not save the data if you are just exploring your data or the options that EcoNicheS offers.")),
choices = list("Save all layers" = 1, "Save edited layers" = 2, "Do not save" = 3), selected = 1)),
conditionalPanel(
condition = "input.options_env_mode == 3",
radioButtons("save_data_env_inter", div("Data saving", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "This option will automatically save the downloaded layers in .asc format along with their complementary files to your working directory. You can also choose not to save the data if you are just exploring your data or the options that EcoNicheS offers.")),
choices = list("Save layers" = 1, "Do not save" = 2), selected = 1)),
conditionalPanel(
condition = "input.options_env_mode == 1 && input.save_data == 1 && input.options_crop_global == 1 || input.options_env_mode == 1 && input.save_data_env == 1 && input.options_crop_global == 2 ",
textInput("identifier_env", div("Identifier", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Please enter some useful identifier for you. This helps us to store the data in order and avoid its loss.")))),
conditionalPanel(
condition = "input.options_env_mode == 1 && input.options_crop_global == 2 && input.save_data_env == 1 || input.options_env_mode == 1 && input.options_crop_global == 2 && input.save_data_env == 2",
textInput("identifier_env_crop", div("Identifier Edited Files", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Please enter some useful identifier for you. This helps us to store the data in order and avoid its loss.")))),
conditionalPanel(
condition = "input.options_env_mode == 2 && input.save_data == 1 && input.options_crop == 1 || input.options_env_mode == 2 && input.save_data_env == 1 && input.options_crop == 2",
textInput("identifier_country", div("Identifier", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Please enter some useful identifier for you. This helps us to store the data in order and avoid its loss.")))),
conditionalPanel(
condition = "input.options_env_mode == 2 && input.options_crop == 2 && input.save_data_env == 1 || input.options_env_mode == 2 && input.options_crop == 2 && input.save_data_env == 2",
textInput("identifier_country_crop", div("Identifier Edited Files", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Please enter some useful identifier for you. This helps us to store the data in order and avoid its loss.")))),
conditionalPanel(
condition = "input.options_env_mode == 3 && input.save_data_env_inter == 1",
textInput("identifier_interactive", div("Identifier Edited Files", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Please enter some useful identifier for you. This helps us to store the data in order and avoid its loss.")))),
conditionalPanel(
condition = "input.options_env_mode == 1 && input.options_crop_global == 1 || input.options_env_mode == 1 && input.options_crop_global == 2 || input.options_env_mode == 2 && input.options_crop == 1 || input.options_env_mode == 2 && input.options_crop == 2",
actionButton("envRun", "Obtain data")),
conditionalPanel(
condition = "input.options_env_mode == 3",
actionButton("envRun2", "Obtain data"))
), #box
box(
width = NULL,
conditionalPanel(
condition = "input.options_crop == 3",
fileInput("mask_file_eco", div("Upload mask file (.asc)", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Upload the .asc file that will act as a mask to crop the layers downloaded from WorldClim.")), accept = ".asc"),
actionButton("process_mask_eco", "Process and Mask Layers p")
),
conditionalPanel(
condition = "input.options_crop_myown == 1 && input.options_env_mode == 4",
fileInput("layers_set", div("Upload environmental layers (.asc)", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Upload the layers in .asc format that you want to edit using another .asc file as a reference for cropping.")), multiple = TRUE, accept = ".asc"),
fileInput("mask_file", div("Upload mask file (.asc)", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Upload the .asc file that will act as a mask to crop the layers.")), accept = ".asc"),
actionButton("process_mask", "Process and Mask Layers")
),
conditionalPanel(
condition = "input.options_crop_myown == 2 && input.options_env_mode == 4",
fileInput("shape_set", div("Upload shape files", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Upload all files related to the.shp file.")), multiple = TRUE),
fileInput("maskCut", div("Upload environmental layers (.asc)", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Upload the layers in .asc format that you want to edit using another .asc file as a reference for cropping.")), accept = ".asc", multiple = TRUE),
textInput("output_maskcut", div("Output Identifier", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Please enter some useful identifier for you. This helps us to store the data in order and avoid its loss.")), value = "Edited-Crop"),
actionButton("shape_cut", "Process and Mask Layers")
)
) #box
), #column
column(width = 8,
box(
width = NULL,
title = div("Visualization", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "You will be able to see a graphical preview of the downloaded data through maps. In addition, here you can delimit the geographical area of your interest through an interactive map if you select that option.")),
conditionalPanel(
condition = "input.options_env_mode == 1 && input.options_crop_global == 1 || input.options_env_mode == 1 && input.options_crop_global == 2",
plotOutput("env_plot_all")),
conditionalPanel(
condition = "input.options_env_mode == 2 && input.options_crop == 3",
plotOutput("env_plot_all_mask")),
conditionalPanel(
condition = "input.options_env_mode == 2 && input.options_crop == 1 || input.options_env_mode == 2 && input.options_crop == 2",
plotOutput("env_plot_country")),
conditionalPanel(
condition = "input.options_crop == 2 && input.options_env_mode == 2",
plotOutput("env_plot_crop")),
conditionalPanel(
condition = "input.options_crop_global == 2 && input.options_env_mode == 1",
plotOutput("env_plot_crop_all")),
conditionalPanel(
condition = "input.options_env_mode == 3",
leafletOutput("map_envlayers") # Mapa interactivo para recortar
),
conditionalPanel(
condition = "input.options_env_mode == 3",
plotOutput("env_plot_crop_all_map")
),
conditionalPanel(
condition = "input.options_crop_myown == 1 && input.options_env_mode == 4",
plotOutput("env_plot_mask_mo")),
conditionalPanel(
condition = "input.options_crop == 3 && input.options_env_mode == 2",
plotOutput("env_plot_mask__eco")),
conditionalPanel(
condition = "input.options_crop_myown == 2 && input.options_env_mode == 4",
plotOutput("cropshp_output", height = "800px"))
) #box
) #column
) #fluipage
), #tabitem
########## environmental
tabItem(tabName = "subtab1",
fluidPage(
titlePanel("Get and clean GBIF data"),
fluidRow(
column(width = 4,
box(
title = div("Species Search", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "This is the species search engine that allows you to obtain data directly from GBIF. Make sure you enter the correct name composed of the genus and the species as you will not be able to cancel the action until the data search is complete.")),
width = NULL,
textInput("species_name", div("Species scientific name", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Enter the scientific name of the species of interest with a space between the genus and the species. The search engine is not case sensitive."))),
numericInput("limit_occ", div("Data Limit", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "It is the amount of data that will be downloaded from GBIF. The download is carried out prioritizing the most current data in case the number entered does not cover all the records.")), value =1000),
actionButton("runOcc", "Obtain occurrences")
), #box
## pls dios
# Quite el conditional panel un momento
box(
title = div("Filters", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "The raw data of the geographical distribution of the searched species is saved automatically, once you obtain the search results, you can filter it by geographical area and year in this section.")),
width = NULL,
conditionalPanel(condition = "output.wmPlot === undefined || output.wmPlot === null",
"This box will display the filters available to clean the occurrence data once the data search is complete.",
),
conditionalPanel(
condition = "output.wmPlot !== undefined && output.wmPlot !== null",
numericInput("km", "Limit (km)", value = 100),
numericInput("Year_Y", div("Year from which the information is desired", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Data older than the year entered will be deleted.")), value = 2000),
selectInput("geographicfilter", div("Select a geographic filter type", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "You can limit the distribution data to the geographic area of your interest using latitude and longitude data or using a country or set of countries of interest.")), choices = c('Filter by country', 'Filter by latitude and longitude'), multiple = TRUE),
conditionalPanel(
condition = "input.geographicfilter.indexOf('Filter by latitude and longitude') !== -1",
numericInput("study_area", "Maximum latitude (Y)", value=40),
numericInput("study_long", "Maximum longitude (X)", value=180)
), #conditional panel
conditionalPanel(
condition = "input.geographicfilter.indexOf('Filter by country') !== -1",
uiOutput("country_select")
),
actionButton("Remove_l_p_r", "Filter occurrences")
) #gbif y uotput
) # box
), #colum
column(width = 8,
box(
width = NULL,
title = div("Visualization of Geographic distribution of the species", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Here you can see through maps and tables a summary of the distribution of the species of interest.")),
leafletOutput("wmPlotleaf"),
plotOutput("wmPlot"),
conditionalPanel(
condition = "output.wmPlot !== undefined && output.wmPlot !== null",
plotOutput("plotflag_output"),
plotOutput("plot_remove"),
dataTableOutput("Countryr_R"),
tableOutput("Year_R")
)#mainp creo que este es box
) #box y este column
) #column
) #fluidrow
)
),
######################################################################################
#############
tabItem(tabName = "subtab2",
fluidPage(
titlePanel("Clean my own database"),
fluidRow(
column(width = 4,
box(
title = div("Clean data out of GBIF", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "In this section you can process the GBIF data using the spThin library. The data is filtered such that within a certain number of kilometers around there is only one record.")),
width = NULL,
fileInput("file_for_cleaning", "Load Database with occurrences (.csv)", accept = ".csv"),
actionButton("vis_map", div("View on a map", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "PView presence data on a map before processing it."))),
textInput("LAT", div("Column name with latitudes (Y)", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Enter the name of the column in your file where the latitude data is located. Respect uppercase, lowercase, spaces and numbers."))),
textInput("LONG", div("Column name with longitudes (X)", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Enter the name of the column in your file where the longitude data is located. Respect uppercase, lowercase, spaces and numbers."))),
textInput("SPEC", div("Column name with species name", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Enter the name of the column in your file where the name of your species is located. Respect uppercase, lowercase, spaces and numbers."))),
textInput("nameSPEC", "Species name"),
numericInput("km_redonda", div("Limit (km)", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Number of kilometers around where you expect to filter to keep a single record.")), value = 1),
textInput("cleaned_name", "Cleaned database output name:", value = "SpeciesOccurrences"),
actionButton("check", div("Check that the data matches", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Please first use this button to verify that the requested data matches your database. Confirm the information provided if this is not the case."))
),
verbatimTextOutput("status_message_display"),
actionButton("clean_my_odb", "Clean database"),
tags$script("shinyjs::disable(\"clean_my_odb\")")
) #box
), #column
column(width = 8,
box(
title = div("Visualization", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "View your data before processing it.")),
width = NULL,
tableOutput("onlyclean_table"),
leafletOutput("mywonPlotleaf")
) # box
) # column
) #fluidrow
) #fluidpage
), #tabitem
##########################################################
#############################################################
tabItem(tabName = "tab4",
fluidPage(
titlePanel("Load and Plot Maps"),
column(width = 4,
box(
title = "Upload map for visualization",
width = NULL,
fileInput("file_maps", "Select map file:",
accept = c('.tiff','.tif', '.asc', '.bil')),
actionButton("load_leaflet_button", "Load Leaflet Map")
) #box
), #column
column(width = 4,
box(
title = div("Interactive Plot", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "In this section you can view your file on an interactive map after you have loaded the map.")),
width = NULL,
leafletOutput("leaflet_map"))),
column(width = 4,
box(
title = div("PDF preview", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "You will be able to see a visualization of the graph of your map, and you will also be able to download the same graph in pdf.")),
width = NULL,
plotOutput("mapPlot"),
conditionalPanel(
condition = "output.mapPlot !== undefined && output.mapPlot !== null",
downloadButton("download_pdf_button", "Download Map as PDF", disabled = TRUE))
))
) #fluidpage
), #tabitem
##################################################
##########################################
tabItem(tabName = "tab5",
fluidPage(
titlePanel("Correlation Layers"),
column(width = 4,
box(
title = div("Obtain the Pearson correlation and Variance inflation factor", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "The raster layers are processed, the result allows you to discard highly correlated variables.")),
width = NULL,
fileInput("file_input", div("Upload the environmental variables", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Multiple file selection button, the allowed formats are '.tiff', '.tif', '.asc' and '.bil'.")), multiple = TRUE, accept = c('.tiff','.tif', '.asc', '.bil')),
sliderInput("threshold_hm", div("Umbral (th)", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Correlation threshold above which the correlation between the variables will be determined.")), min = 0, max = 1, value = 0.7, step = 0.1),
actionButton("analyze_button", "Calculate Correlation")
) #box
), #column
column(width = 8,
box(
title = div("Heatmap", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "The heatmap graph will be shown here in addition to the complementary data that provides information about the variables with respect to them.")),
width = NULL,
plotOutput("cor_plot"),
uiOutput("cor_output"),
uiOutput("v2_output"),
conditionalPanel(
condition = "output.cor_plot !== undefined && output.cor_plot !== null",
downloadButton("download_heatmap_pdf", "Download Heatmap (PDF)")
)
) #box
) #column
) #fluidpage
),
##################################################
##########################################
tabItem(tabName = "tab6",
fluidPage(
titlePanel("Points and pseudoabsences"),
fluidRow(
column(width = 4,
box(
title = div("Distribution base data", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "In this section, pseudo-absences are generated from the distribution data. This data serves as background for niche modeling.")),
width = NULL,
fileInput("occurrences", div("Upload occurrence data", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Provides the file with the points of presence of the species. The file must be processed and filtered if applicable, always in .csv format. For data obtained outside of EcoNiches, remember to edit the file so that the column names match those required for analyzes in the application. Visit the user manual for more information.")), accept = ".csv"),
fileInput("mask", div("Upload an .asc file", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Upload any of the environmental layers relevant to your study. The accepted formats are '.tiff','.tif', '.asc' and '.bil'.")), accept = c('.tiff','.tif', '.asc', '.bil')),
textInput("num_points", div("Number of random points", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Number of pseudo-absence data that will be generated. This data will be assigned a response, 0, while the original presence points will show the value 1 as a response. The execution time depends on the number entered, if you are carrying out tests we recommend carrying them out with small values.")), value = "1000"),
textInput("output_name", div("Database output name", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Enter a valid name to save the database, a .csv file where, in addition to the original data, you will find the Pseudoabsences generated and the responses of both data. Doing this makes it easier to create and store the data.")), value = "Speciespointspa.csv"),
actionButton("run_script", "Generate data")
) #box
), #column
column(width = 8,
box(
title = div("Pseudoabsences Results", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "In this section you can view the results with the data generated through maps.")),
width = NULL,
plotOutput("abs_output"),
conditionalPanel(
condition = "output.abs_output !== undefined && output.abs_output !== null",
downloadButton("download_pdfpseudo", "Download PDF"))
), #box
box(
width = NULL,
leafletOutput("abs_output_inte")
)#box
) #column
) #fluidrow
)
), #tabitem
####################333
###################33
#######33
tabItem(tabName = "tab7",
fluidPage(
titlePanel("biomod2"),
fluidRow(
column(width = 4,
box(
title = div("Database repository", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Provides the databases necessary for ecological niche modeling. For more information click on the user manual.")),
width = NULL,
fileInput("file", div("Presence - Pseudoabsence Data", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Upload the file generated in the previous section of EcoNiches (Points and Pseudoabsences). The points of presence with the generated pseudo-absences and their response in .csv format are required.")), accept = ".csv"),
fileInput("layerFiles", div("Environmental variables", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Upload related environmental variables. In EcoNiches these are pre-processed in the 'Correlation Layers' section. The accepted formats are '.tiff','.tif', '.asc' and '.bil'.")), multiple = TRUE, accept = c('.tiff','.tif', '.asc', '.bil'))
), #box1
box(
title = div("Configuration of models for niche analysis", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Adjust the parameters for Ecological Niche Modeling. For more information and details visit the User Manual.")),
width = NULL,
selectInput("modelSelection", div("Single Models", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Choose the models or algorithms used during the analysis and evaluation. These are the single models functions, for more information go to the User Manual and/or visit the biomod2 vignette on github.")),
choices = c('GLM','GBM','GAM','CTA','ANN','SRE','FDA','RF','MAXENT','MAXNET','MARS','XGBOOST'),
multiple = TRUE),
selectInput("strategy_Selection", div("Select Strategy", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Strategy used during the calibration and validation of the models, for more information go to the User Manual and/or visit the biomod2 vignette on github.")),
choices = c('random','k-fold','block','strat','env','user.defined'),
multiple = FALSE),
selectInput("metricSelection", div("Select Evaluation Metrics", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Model performance and accuracy evaluation metrics, for more information go to the User Manual and/or visit the biomod2 vignette on github.")),
choices = c('KAPPA','TSS','ROC'),
multiple = TRUE),
numericInput("dataSplit", div("Data Split Percentage", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Number of 'pieces' into which the data will be divided for the calibration of the models, for more information go to the User Manual and/or visit the biomod2 vignette on github.")), value = 80),
numericInput("dataRep", div("Number of Repetitions", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Repetitions applied for each of the selected models, for more information go to the User Manual and/or visit the biomod2 vignette on github.")), value = 10),
sliderInput("threshold", div("Selection Threshold", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Evaluation and selection threshold applied in the evaluation of the response of the models, for more information go to the User Manual and/or visit the biomod2 vignette on github.")), min = 0, max = 1, value = 0.4, step = 0.1),
selectInput("evalMetrics", div("Select Evaluation Metrics", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Adjust the parameters for Ecological Niche Modeling.")),
choices = c('KAPPA','TSS','ROC'),
multiple = FALSE),
actionButton("runBiomod", "Run biomod2 models")
) #box2
), #column
column(width = 8,
box(
title = "Model Results",
width = NULL,
tabsetPanel(
tabPanel("Database", tableOutput("data_table")),
tabPanel("Model Output", verbatimTextOutput("modelOutput")),
tabPanel("Evaluation",
plotOutput("evalScoresPlot"),
downloadButton("downloadEvalScoresPlotPDF", "Download PDF")),
tabPanel("Important Variables",
plotOutput("varImpBoxplot"),
downloadButton("downloadVarImpBoxplotPDF", "Download PDF")),
tabPanel("Response Curves",
plotOutput("responseCurvesPlot"),
downloadButton("downloadResponseCurvesPlotPDF", "Download PDF"),
plotOutput("responseCurvesPlotMin"),
downloadButton("downloadResponseCurvesPlotMinPDF", "Download PDF"),
plotOutput("responseCurvesBivariatePlot"),
downloadButton("downloadResponseCurvesBivariatePlotPDF", "Download PDF"))
) #tabset
)) # column y box
) #fluidrow
) #fluidpage
), # tab
#################################
#############################################
#######################################################
tabItem(tabName = "tab8",
fluidPage(
titlePanel("Load and Plot Maps"),
column(width = 4,
box(
title = "Upload map for visualization",
width = NULL,
fileInput("file_maps2", "Select map file:",
accept = c('.tiff','.tif', '.asc', '.bil')),
actionButton("load_leaflet_button_2", "Load Leaflet Map")
) #box
), #column
column(width = 8,
box(
title = div("Interactive Plot", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "In this section you can view your file on an interactive map after you have loaded the map.")),
width = NULL,
leafletOutput("leaflet_map_2", height = "600px")
) #box
) #column
) #fluidpage
),
#################################
#############################################
#######################################################
tabItem(tabName = "tab9",
fluidPage(
titlePanel("Partial ROC Analysis"),
column(width = 4,
box(
title = div("Upload your databases", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "This is a tooltip for the title")),
width = NULL,
fileInput("sdm_mod", div("Upload prediction raster", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Upload the consensus map obtained during the Ecological Niche Modeling. Visit the user manual for more information.")), accept = c('.tiff','.tif', '.asc')),
fileInput("occ_proc", div("Upload Validation Data", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Upload the file that contains only the presence points of the species of interest. The format must be (.csv).")), accept = ".csv"),
numericInput("iter", div("Number of bootstrap iterations ", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Iterations to be performed. Visit the user manual for more information.")), value = 500),
numericInput("omission", "Threshold", value = 5),
numericInput("randper", "Percent", value = 50),
actionButton("runButtonEnmEval", "Run ROC (0-1)"),
actionButton("runButtonBiomod2", "Run ROC (0-100)")
) #box
), #column
column(width = 8,
box(
title = "Results",
width = NULL,
verbatimTextOutput("errorMessage"),
tableOutput("summaryroc"),
dataTableOutput("resultsroc")
) #box
) #column
) #fluidpage
),
#
#################################
#############################################
#######################################################
tabItem(tabName = "tab10",
fluidPage(
titlePanel("Remove urbanization"),
column(width = 4,
box(
title = div("Environmental data", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "This section allows you to remove information from your environmental layers using another file as a reference. Below you can upload the necessary files.")),
width = NULL,
fileInput("archivoUrban", div("Select the urbanization file", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "This file should contain the data you want to remove. The allowed extensions are '.tiff','.tif', '.asc' and '.bil'.")),
accept = c('.tiff','.tif', '.asc', '.bil')),
fileInput("archivomodelado", div("Select the Potential distribution map", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "This is the file you want to be edited. The allowed extensions are '.tiff','.tif', '.asc' and '.bil'.")),
accept = c('.tiff','.tif', '.asc', '.bil')),
textInput("nombreSalida", div("Output file name", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "The edited version will be automatically saved in your working directory, enter the output name for easy storage and identification."))),
actionButton("ejecutar", "Run Analysis")
)
), #column
column(width = 8,
box(
title = div("Urbanization", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Visualization of the map with urbanization data.")),
width = NULL,
leafletOutput("mapa_urban")
),
box(
title = div("Potencial distribution", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Visualization of the map with potential distribution data before editing.")),
width = NULL,
leafletOutput("mapa_modelado")
),
box(
title = div("Result", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Visualization of the edited raster layer.")),
width = NULL,
leafletOutput("mapa_urbancapa")
)
) #column 8
) #fluidpage
),
#
#################################
#############################################
#######################################################
tabItem(
tabName = "tab11",
fluidPage(
titlePanel("Calculate area"),
column(
width = 4,
box(
title = div("Data", tags$i(class = "fas fa-question-circle",
"data-toggle" = "tooltip",
"title" = "Upload a raster file for the calculation of the area of suitability. The allowed formats are '.tiff', '.tif', '.asc', and '.bil'.")),
width = NULL,
condition = "input.opcionAnalisis == 'Calculate area'",
fileInput("archivoRaster", "Select raster file", accept = c('.tiff', '.tif', '.asc', '.bil')),
numericInput("umbralSuitability", "Suitability Threshold:", value = 0.7, min = 0, max = 1, step = 0.01),
actionButton("calcularArea", "Calculate Area of Suitability"),
br(), br(),
downloadButton("downloadAscThreshold", "Download Map (.asc)"),
downloadButton("downloadPdfThreshold", "Download Map (PDF)")
)
),
column(
width = 8,
box(
title = "Result",
width = NULL,
verbatimTextOutput("Result"), # Display numerical area result
plotOutput("areaMap") # Display raster map highlighting the suitable area
)
)
)
),
#################################
#############################################
#######################################################
tabItem(tabName = "tab12",
fluidPage(
titlePanel("Gains and Losses Plot"),
column(width = 4,
box(
title = div("Environmental data from different periods", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "You can obtain prediction of environmental changes from different raster layers.")),
width = NULL,
fileInput("mapa_presente_input", div("Load Map 1", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Upload different maps to evaluate the differences, losses and gains between them. The allowed formats are '.tiff','.tif', '.asc' and '.bil'.")), accept = c('.tiff','.tif', '.asc', '.bil')),
fileInput("mapa_futuro_input", div("Load Map 2", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Upload different maps to evaluate the differences, losses and gains between them. The allowed formats are '.tiff','.tif', '.asc' and '.bil'.")), accept = c('.tiff','.tif', '.asc', '.bil')),
actionButton("run_analysis_btn", "Run Analysis")
)
),
column(width = 4,
box(
width = NULL,
title = div("Gains Plot", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Through a graph you will observe the evaluation of the quantitative changes concerning the gains in the landscape.")),
status = "primary",
plotOutput("Gains_plot"),
conditionalPanel(
condition = "output.Gains_plot !== undefined && output.Gains_plot !== null",
downloadButton("download_Gains", "Download Gains Map")
)
)
),#column
column(width = 4,
box(
width = NULL,
title = div("Losses Plot", tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip", "title" = "Through a graph you will observe the evaluation of the quantitative changes concerning the losses in the landscape.")),
status = "danger",
plotOutput("Losses_plot"),
conditionalPanel(
condition = "output.Losses_plot !== undefined && output.Losses_plot !== null",
downloadButton("download_Losses", "Download Losses Map")
)
)
) #column
)
),
#################################
#############################################
#######################################################
tabItem(tabName = "tab13",
fluidPage(
titlePanel("Niche Overlap Analysis via ENMTools"),
fluidRow(
column(width = 4,
box(
title = div("Upload data for analysis",
tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip",
"title" = "Provides the databases for the analysis and construction of models and niche overlap analysis through ENMTools.")),
width = NULL,
fileInput("sp1_enmtools",
div("Distribution data of Species 1",
tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip",
"title" = "Database with the points of presence and pseudo-absences of species 1 in .csv format. The column names should be Species, X and Y. X refers to the longitude data and Y to the latitude data.")),
accept = ".csv"),
fileInput("sp2_enmtools",
div("Distribution data of Species 2",
tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip",
"title" = "Database with the points of presence and pseudo-absences of species 2 in .csv format. The column names should be Species, X and Y. X refers to the longitude data and Y to the latitude data.")),
accept = ".csv"),
fileInput("layerFilesENM",
div("Upload environmental layers",
tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip",
"title" = "Upload the environmental variables relevant to your study (evaluated through correlation).")),
multiple = TRUE, accept = c('.tiff', '.tif', '.asc', '.bil')),
selectInput("model_niche",
div("Select Model(s)",
tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip",
"title" = "Model for the construction and projection of ENMs. You can select multiple models; the selection will apply to both species.")),
choices = c('glm', 'gam', 'dm', 'bc', 'mx'),
multiple = TRUE),
radioButtons("options_species_model",
"Would you like to build an ENM for both species?",
choices = list("Yes" = 1, "No, species 2 data is for overlap analysis only." = 2),
selected = 1)
),
box(
title = div("Hypothesis testing",
tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip",
"title" = "Different tests can be performed to evaluate niche overlap. Go to the user manual or visit ENMTools on GitHub.")),
width = NULL,
solidHeader = TRUE,
checkboxGroupInput("checkbox_opciones",
"Select the analyzes to perform:",
choices = list("Niche identity or equivalency test" = 1, "Background or similarity test (Asymmetric)" = 2, "Background or similarity test (Symmetric)" = 3),
selected = 1),
selectInput("model_niche_s",
div("Select Model(s)",
tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip",
"title" = "Type of model to be built for the selected tests.")),
choices = c('glm', 'gam', 'dm', 'bc', 'mx'),
multiple = TRUE)
),
box(
title = div("Rangebreak tests",
tags$i(class = "fas fa-question-circle", "data-toggle" = "tooltip",
"title" = "Select a model to carry out the test according to Glor and Warren (2011). For questions and details, refer to the user manual or GitHub.")),
width = NULL,
solidHeader = TRUE,
radioButtons("options_rblmodel",
"Select an option:",
choices = list("GLM" = 1, "GAM" = 2, "DM" = 3, "BC" = 4, "MAXENT" = 5),
selected = 1)
),
box(
width = NULL,
solidHeader = TRUE,
actionButton("run_enmtools", "Run ENMTools")
)
),
column(width = 8,
box(
title = "Model Results",
width = NULL,
tabsetPanel(
tabPanel("Model Summary Sp1",
conditionalPanel(
condition = "input.model_niche.includes('glm')",
box(title = "GLM model",
width = NULL,
plotOutput("modelPlot_glm"),
downloadButton("downloadPdf_glmmodel", "Download PDF"),
verbatimTextOutput("modelSummary_glm")
)
),
conditionalPanel(
condition = "input.model_niche.includes('gam')",
box(title = "GAM model",
width = NULL,
plotOutput("modelPlot_gam"),
downloadButton("downloadPdf_gammodel", "Download PDF"),
verbatimTextOutput("modelSummary_gam")
)
),
conditionalPanel(
condition = "input.model_niche.includes('dm')",
box(title = "DM model",
width = NULL,
plotOutput("modelPlot_dm"),
downloadButton("downloadPdf_dmmodel", "Download PDF"),
verbatimTextOutput("modelSummary_dm")
)
),
conditionalPanel(
condition = "input.model_niche.includes('bc')",
box(title = "BC model",
width = NULL,
plotOutput("modelPlot_bc"),
downloadButton("downloadPdf_bcmodel", "Download PDF"),
verbatimTextOutput("modelSummary_bc")
)
),
conditionalPanel(
condition = "input.model_niche.includes('mx')",
box(title = "MX model",
width = NULL,
plotOutput("modelPlot_mx"),
downloadButton("downloadPdf_mxmodel", "Download PDF"),
verbatimTextOutput("modelSummary_mx")
)
)
),
tabPanel("Model responses Sp1",
conditionalPanel(
condition = "input.model_niche.includes('glm')",
box(title = "GLM model",
width = NULL,
plotOutput("resp_plot_glm"),
plotOutput("test_data_glm")
)