-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.R
56 lines (48 loc) · 1.76 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
#
# This is the server logic of a Shiny web application. You can run the
# application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
# Define server logic required to draw a histogram
shinyServer(function(input, output) {
data <- reactive({
x <- casos
})
output$mapa_cov <- renderLeaflet({
casos <- datacov2
m <- leaflet(data = casos, options = leafletOptions(minZoom = 4, maxZoom = 4)) %>%
addTiles() %>%
# addProviderTiles(providers$CartoDB.DarkMatterNoLabels) %>%
addProviderTiles(providers$CartoDB.PositronNoLabels) %>%
addCircleMarkers(
lng = ~Long,
lat = ~Lat,
weight = 3,
# radius=40,
radius = ~log(confirmed),
color = "#ff7761",
stroke = FALSE, fillOpacity = 0.8,
popup = paste(casos$country, "<br>",
"<b>Casos confirmados: </b>", casos$confirmed, "<br>",
"<b>Fallecidos: </b>", casos$death)
) %>%
# addCircleMarkers(
# lng = ~Long,
# lat = ~Lat,
# weight = 3,
# # radius=40,
# radius = ~log(death),
# color = "#ff7473",
# stroke = FALSE, fillOpacity = 0.5,
# popup = paste(casos$country, "<br>",
# "<b>Casos confirmados: </b>", casos$confirmed, "<br>",
# "<b>Fallecidos: </b>", casos$death)
# ) %>%
setView(lng=-75, lat=-12 , zoom=4)
m
})
})