from this question I managed to create a SpatRaster object that has proper colors plotted. But now I am in a bind as to how to add markers in the map that show specific points in space from coordinates.
library(terra)
img <- rast("https://i.stack.imgur.com/ZyyaD.jpg")
crs(img) <- "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m"
ext(img) <- c(-9390939.6587, -9327758.7787, 1095038.6805, 1127491.1389)
What would be the simplest way to add points to positions parting from coordinates? I have in mind something like this:
plot(img)
coordinates<-data.frame(lat=c(10.00236,9.93333),
long=c(-84.11651,-84.08333),place=c("heredia","San José"))
points(coordinates)
This does not work, but I hope it gets the message if what I need to do.