-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap_US_MeXwithstates_sites
More file actions
30 lines (25 loc) · 1.17 KB
/
Copy pathmap_US_MeXwithstates_sites
File metadata and controls
30 lines (25 loc) · 1.17 KB
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
ryp<-read.table(file.choose(), sep=",", header=TRUE )
cryp$pop
library(rgeos)
library(sf)
library(rgdal)
library(maps)
na_sf <- st_as_sf(map("world", regions=c("usa", "canada", "mexico"), plot = FALSE, fill = TRUE))
conus_sf <- st_as_sf(map("state", plot = FALSE, fill = TRUE))
na2_sf <- rbind(na_sf, conus_sf)
P<-ggplot(data = na2_sf ) +
geom_sf(fill = "cornsilk") +
geom_jitter(data = cryp, aes(x = Long, y = Lat,color = pop, size =1.0,),position = position_jitter(width = 0.2, height = 0.1)) +
# annotate(geom = "text", x = -168, y = 58, label = "Bering Sea", # edit to add in text to map
# fontface = "italic", color = "grey22", size = 5) +
coord_sf(xlim = c(-110.15, -70.01), ylim = c(18, 45.2), expand = FALSE)+ # coords of plot
xlab("Longitude") +
ylab("Latitude")
#ggtitle("Map of XX sites")
P + theme(panel.grid.major = element_line(colour = gray(0.5), linetype = "dashed",
size = 0.5), panel.background = element_rect(fill = "aliceblue"),
panel.border = element_rect(fill = NA))
#Manually color points
P + scale_color_manual(values=c("green", "red", "purple", "blue","Orange","grey"))
P
dev.off()