-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOccurrence map.R
32 lines (26 loc) · 950 Bytes
/
Occurrence map.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
data <- read.csv("data/cleanedData.csv")
library(leaflet)
library(mapview)
library(webshot2)
data<- read_csv("data/cleanedData.csv")
# Generate occurrence map
map <- leaflet(options = leafletOptions(zoomControl = FALSE)) %>%
# The options bit removes the zoom button
# Add base map
# More options here: https://leaflet-extras.github.io/leaflet-providers/preview/
addProviderTiles("Esri.WorldTopoMap") %>%
# Add occurrence points
addCircleMarkers(data = data,
lat = ~decimalLatitude,
lng = ~decimalLongitude,
radius = 3,
color = "coral",
fillOpacity = 0.8) %>%
# Add legend/title
addLegend(position = "topright",
title = "Species Occurences from GBIF",
labels = "Columbia torrent salamander",
colors = "coral")
map
# Save the map
mapshot2(map, file = "output/rhyacotritonOccurenceMap.png")