Of course, R could also be used to create more traditional atlas dot maps; coastal outlines of Britain are freely available in more than one R package, and occurrence data relating to the UK grid could be manipulated in R to centre on monads, tetrads or hectads. External tools could also be used to do this before loading the data into R, e.g. see here.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library (sp) | |
library (rgdal) | |
library (OpenStreetMap) | |
library (ggplot2) | |
setwd("C:/.../water_bent") | |
water_bent<-read.csv("water_bent.csv") #columns: x; y; Size | |
water_bent4map<-water_bent | |
coordinates(water_bent4map) = ~x+y # turns dataframe into a SpatialPointsDataFrame | |
proj4string(water_bent4map) = CRS("+init=epsg:27700") # tells it to be UK OSGrid | |
# retrieve basemap | |
map <- openmap(c(53.40,-1.550), | |
c(53.36,-1.475),type="osm-bw") # corners of retrieved map, see ?openmap | |
osm.Shef <- openproj (map, proj4string(water_bent4map)) # reproject map to OSGB | |
water_bent4map$Size <- as.factor(water_bent4map$Size) | |
autoplot(osm.Shef) + | |
geom_point(data=as.data.frame(water_bent4map),aes(x=x, y=y, size=Size), | |
col="red", alpha=0.6) + | |
theme(axis.title.x=element_blank(), # suppress axis label | |
axis.title.y=element_blank(), # suppress axis label | |
axis.text.x=element_text(colour="black",size="19"), | |
axis.text.y=element_text(colour="black",size="19"), | |
legend.position=c(0.112,0.877), | |
legend.text=element_text(size=18), | |
legend.title=element_text(size=20)) + | |
annotate("text", label = "(SK)", x = 430350, y = 385100, size=14) + | |
scale_size_manual(values = c(8,12,18), name = "Population size", labels = c("1-2","20-50",">100")) #scale points by size #manually |
The result is below. I'd be grateful to hear from anyone who can suggest any refinements to my code, or the general way in which I've gone about this.
![]() |
Polypogon viridis in Sheffield, UK, 2013 |