Hi @Boru446,
Welcome to the RStudio Community Forum.
You were very close with your code. This version works with the data you provided:
a <- "
58.223914;-6.386988;L;Island;Varroa;Honey Bees;Island + Varroa + Honey Bees
57.051801;-5.923568;S;Island;Varroa;Honey Bees;Island + Varroa + Honey Bees
56.598782;-6.627109;Coll;Island;Varroa;Honey Bees;Island + Varroa + Honey Bees
56.62349;-6.073362;Mull;Island;NoVarroa;Honey Bees;Island + Honey Bees
55.698677;-6.445954;I;Island;NoVarroa;Honey Bees;Island + Honey Bees
56.959589;-7.443962;B;Island;NoVarroa;Honey Bees;Island + Honey Bees
56.068724;-6.196989;C;Island;NoVarroa;Honey Bees;Island + Honey Bees
57.153458;-7.308724;SU;Island;NoVarroa;No Honey Bees;Island
57.084832;-7.310713;E;Island;NoVarroa;No Honey Bees;Island
57.010631;-6.265324;R;Island;NoVarroa;No Honey Bees;Island"
islands <- read.delim(text=a, sep=";", header=FALSE)
names(islands) <- c("Lat","Long","Code","Land_type","mite","bees","SiteMiteBees")
islands
library(maps)
# coordinates of the area
map(xlim =c(-10,0), ylim=c(55,60), fill=F, col="black", mar=c(1,1,1,1))
# Put the points on the map and color by type of site
points(islands$Long, islands$Lat, col=islands$SiteMiteBees, pch=19)
# Put the labels on the sites
text(islands$Long, islands$Lat, label=islands$Code, cex=0.8, pos=2)
# Draw a legend
legend("bottomright", legend=unique(islands$SiteMiteBees), pch=19,
col=unique(islands$SiteMiteBees), cex=0.6)
# When the code is working as you want, copy it inside the png()....dev.off()
png("my_map.png", res=600, width = 15, height = 15, units = "cm")
map(xlim =c(-10,0), ylim=c(55,60), fill=F, col="black", mar=c(1,1,1,1))
points(islands$Long, islands$Lat, col=islands$SiteMiteBees, pch=19)
text(islands$Long, islands$Lat, label=islands$Code, cex=0.8, pos=2)
legend("bottomright", legend=unique(islands$SiteMiteBees), pch=19,
col=unique(islands$SiteMiteBees), cex=0.8)
dev.off()
HTH (from a fellow-bee-keeper!)