[R-sig-Geo] Modifying a column in a Shapefile

Juliane Struve juliane_struve at yahoo.co.uk
Fri Oct 3 14:02:50 CEST 2008

Dear list members,

I am using a grid called "MergedCentroids" in which I need to modify entries in  column "NEARANGLE and write the result into a column "NEARANG_R". I have tried to convert the Spatial Points Data Frame to a data frame in order to do this. I want to convert the updated grid into a new shapefile at the end. This is my code so far:

MergedCentroids <- readOGR("Centroids_Merge.shp","Centroids_Merge")
MCSPDF = SpatialPointsDataFrame(MCDF[,3:4],data.frame(MCDF[,1:16]))
After executing the last statement I get two error messages:
Error in write.dbf(df, paste(file, ".dbf", sep = ""), factor2char = factor2char,  :
  unable to open file
In addition: Warning message:
use writeSpatialShape:
objects other than Spatial objects defined in the sp package are deprecated
Would somebody be able to help ? 
Many thanks !

 Dr. Juliane Struve
Environmental Scientist
10, Lynwood Crescent
Sunningdale SL5 0BL
01344 620811

More information about the R-sig-Geo mailing list