I'm trying to write a SpatialPointsDataFrame to a Shape file, like so:
class(sampled_points)
[1] "SpatialPointsDataFrame"
attr(,"package")
[1] "sp"
rgdal::writeOGR(obj=sampled_points, dsn=paste0(getwd(),"/Data"), layer="pixels_pakistan1", driver="ESRI Shapefile")
But I keep on getting this error
Error in rgdal::writeOGR(obj = sampled_points, dsn = paste(getwd(), "/Data"), :
Non-unique field names
I can't seem to find anything on Stack Overflow that explains where this error is coming from, and I feel like I'm using the rgdal::writeOGR function correctly. Any ideas where the issue may be coming from?