-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.R
109 lines (79 loc) · 3.13 KB
/
server.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
library(shiny)
library(shinyWidgets)
library(leaflet)
library(RColorBrewer)
library(tidyverse)
library(shinyjs)
library(scales)
library(rpivotTable)
#setwd()
#options(rsconnect.check.certificate = FALSE)
#rsconnect::deployApp()
#source(file = "global.R")
# Define server logic for slider examples
shinyServer(function(input, output, session) {
points <- callModule(
module = selectizeGroupServer,
id = "my_filters",
data = tablaRG3,
vars = c("genero", "proyecto", "estatus_ecologico", "estado"),
inline = FALSE
)
points1 <- reactive({
columna1 <- c(ifelse(input$color_dot == "Proyecto",
names(points())[10], names(points())[9])) %>%
as.character()
})
#P el mapa en leaflet
output$mymap1 <- renderLeaflet(
{
columna1 <- points1()
TTablaL <- points() %>%
select(all_of(columna1)) %>%
as.data.frame()
Goldberg <- TTablaL %>%
as.data.frame() %>%
bind_cols(points())
names(Goldberg)[1] <- c("colores111")
# color11 <- ifelse(input$color_dot = FALSE, Goldberg %>% select(colores_genero),
# Goldberg %>% select(colores_proyecto))
# uno1 <- as.vector(Goldberg$colores_proyecto)
# dos2 <- as.vector(Goldberg$colores_genero)
# TT <- paste(Goldberg$Raza_primaria)
# leaflet(options = leafletOptions(zoomControl = FALSE,
# # minZoom = 3,
# maxZoom = 8,
# dragging = FALSE)) %>%
leaflet() %>%
addTiles(
# options = providerTileOptions(maxZoom = 8)
) %>%
addCircleMarkers(Goldberg$long, Goldberg$lat,
weight = 8, radius = 5, stroke = F, fillOpacity = 0.7,
#color = ifelse(input$color_dot, Goldberg$colores_proyecto, Goldberg$colores_genero),
color = Goldberg$colores111,
# color = "red",
# fillColor = color,
#color = uno1,
popup = paste(sep = " ",
# "Num. colecta:",Goldberg$numero_colecta_observacion,"<br/>",
"Proyecto:",Goldberg$proyecto,"<br/>",
"Especie:",Goldberg$especie,"<br/>",
"Status ecológico:",Goldberg$estatus_ecologico,"<br/>"
#"Latitud:",Goldberg$lat,"<br/>",
#"Longitud:",Goldberg$long
)) %>%
addProviderTiles("CartoDB.Positron")
})
#Para hacer un PivotTable
output$Ceratti3 <- renderRpivotTable({
tablaRG4 <- tablaRG3 %>%
select(proyecto,
estado,
estatus_ecologico,
genero,
epiteto_especifico,
especie)
rpivotTable(tablaRG4)
})
})