I am trying to obtain country names for them and tried the following two
methods. There are some difference (mostly between USA and Canada). While
sometimes method 1 provides a country name but method 2 cannot.
Is there a way to say if either of the methods are more accurate? Or
another more accurate method? Or am I doing something wrong?
#setting CRS directly to that from rworldmap
pointsSP = SpatialPoints(coord_dams,
# use 'over' to get indices of the Polygons object containing each point
indices = over(pointsSP, countriesSP)
# return the ADMIN names of each country
#indices$ISO3 # returns the ISO3 code
#indices$continent # returns the continent (6 continent model)
#indices$REGION # returns the continent (7 continent model)