-
Notifications
You must be signed in to change notification settings - Fork 0
/
us-canada-map.Rmd
62 lines (50 loc) · 1.26 KB
/
us-canada-map.Rmd
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
---
title: "Current Aphasia Research Studies"
---
```{css, echo = F}
/* Don't display the title on the map page so there's more map*/
d-title, d-byline {
display: none
}
d-appendix{
display: none !important;
}
/*Fix for Marker Clusters*/
.marker-cluster {
background-color: #31882A20 !important;
}
.marker-cluster div {
background-color: #31882A !important;
color: #fff !important;
}
d-article{
margin-top: 45px;
max-height: 90vh !important;
padding-top: 0px;
}
```
```{r setup, include=FALSE}
library(here)
library(tidyverse)
library(leaflet)
clinical_trials = read.csv(here("data", "clinical_trials_clean.csv"))
data = clinical_trials %>%
ungroup() %>%
select(name = BriefTitle,NCTId, lon, lat) %>%
mutate(name = gsub("[.]", "", x=name),
link=paste0("list_view.html#",NCTId),
Name = paste0("<a href=", link, ">", name, "</a>")
)
```
```{r echo = F, layout = "l-screen-inset shaded", out.height = "88vh"}
data %>%
rename(lng = lon) %>%
leaflet() %>%
setView(lng = -95, lat = 40, zoom = 4) %>%
addTiles() %>%
addMarkers(popup = ~Name,
clusterOptions = markerClusterOptions(
maxClusterRadius = 40,
showCoverageOnHover = F)
)
```