-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathARG_globalchange_map.R
47 lines (34 loc) · 1.75 KB
/
ARG_globalchange_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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#################################################### Script for ARG Genomic Change Map ########################################################
#creates map and plots lat/lon coordinates for studies that observed genomic change on coral reefs
#outputted figure annotated by hand to add fish/coral clipart & legend
#################################################################################################################################################
######## Set-up ########
remove(list = ls())
#load libraries
library(maps)
library(mapdata)
library(tidyverse)
library(ggthemes)
#pull world map data
world_map <- map_data("world") %>%
filter(! long > 180)
#################################################################################################################################################
######## Create map ########
#### create dataframe with lat/lon coordinates ####
lat <- c(-13.99999, 24.82097, 32.18943, 34.32141, 19.4293, -18.5692,
25.2258, 21.27436, 18.46695, 23.0627, 18.8425) #lat coordinates from 11 examples (pulled from papers)
lon <- c(121.83333, -81.29057, 129.9633, 139.2051, -76.48578, 146.495,
-77.86836, -157.7173, -77.40827, -161.921, -72.933) #lon coordinates from 11 examples (pulled from papers)
latlon_df <- as.data.frame(cbind(lat, lon)) #merge togther
#### Plot coordinates ####
#subset to cutoff map edges
world_map <- map_data("world") %>%
filter(! long > 180)
#create map
globalchange_plot <- world_map %>%
ggplot(aes(map_id = region)) +
geom_map(map = world_map) +
expand_limits(x = world_map$long, y = world_map$lat) +
geom_point(data = latlon_df, aes(x = lon, y = lat), size = 12, inherit.aes = FALSE) +
theme_map()
globalchange_plot