A name is just a name, but be aware of names with spaces in it.
I saw your 'Edit' where you said to have an error with 'Nests'.
To show it works see below (I removed the two output plots).
It should also be working for you: did you change your X2019_Average_Data_Ready
file and did you save it?
The reason that I wrote out manually all the data is that did not have your data set and needed some input to test the code. You had the colony information already available in a data set, so no need for you to type it over.
When I tried to find a source for your world
map I found with google the webpage Drawing beautiful maps programmatically with R, sf and ggplot2 — Part 1: Basics . Maybe also interesting for you.
library(ggplot2)
library("rnaturalearth")
library("rnaturalearthdata")
library("rgeos")
#> Loading required package: sp
#> rgeos version: 0.5-3, (SVN revision 634)
#> GEOS runtime version: 3.8.0-CAPI-1.13.1
#> Linking to sp version: 1.4-1
#> Polygon checking: TRUE
world <- ne_countries(scale = "medium", returnclass = "sf")
X2019_Average_Data_Ready <-
data.frame(
Colony = c('a','b','c'),
Nests = c(3,1,12),
Latitude = c(37.8802,37.4674,37.7297),
Longitude= c(-7.9577,-8.98582,-8.75367),
`Av.No. of Fledglings`=c(1,2,1.25),
stringsAsFactors = F
)
good_map<-ggplot(data=world) +
geom_sf(color='black',fill='darkolivegreen1') +
xlab('Longitude') +
ylab('Latitude') +
ggtitle('South Portugal',
subtitle = ('Stork Nests 2019')) +
coord_sf(xlim = c(-10.167179, -7.355167), ylim = c(36.897690, 39.004960), expand = FALSE)
good_map
Removed the map but is was shown okay (without the points of course)
stork_nest_map<-good_map +
geom_point(data=X2019_Average_Data_Ready,
aes(x=Longitude,y=Latitude,fill=Nests),
shape=21,size=2,color="black")
stork_nest_map
Removed the map but is was shown okay (now with the points)