How to remove unwanted columns from a polygon in R AND keep the result as a spatial d

المشرف العام

Administrator
طاقم الإدارة
To simplify my problem, I'm gonna start at the source instead of explaining my full-map problem.

I have a shapefile of Ethiopia pulled from GADM (can be downloaded here). A lot of the attribute columns are unnecessary and just create extra clunkiness as I perform clips/joins/etc. with the shapefile. So I want to remove all but the first 4 columns. Doing this seems easy enough, and I tried and succeeded with this bit of code:

library(rgdal)#read in shapefileeth
 
أعلى