Greetings:

I would like to kindly ask for a little help. The rough code is:

#________________________________________________________

dat=data.frame(read.delim(file="all.txt", header = TRUE, sep = "\t",
quote="\"", dec=".",na.strings = "NA"))

nc=read.shape("astae.shp", dbf.data=TRUE, verbose=TRUE)

mappolys=Map2poly(nc)

submap <- subset(mappolys, nc$att.data$NAME!="Honolulu, HI")

nc$att.data=subset(nc$att.data, nc$att.data$NAME!="Honolulu, HI")

nc$att.data[,1]=as.numeric(paste(nc$att.data$MSACMSA))

#attributes(nc$att.data)

nc$att.data=merge(nc$att.data, dat, by.x="AREA", by.y="cod", all.x=TRUE,
sort=FALSE)

#attributes(nc$att.data)

tmp=file("tmp")

write.polylistShape(submap, nc$att.data, "tmp")

#_________________________________________________________

All works fine, but merge() changes the rownames and the link between the
polygons and the corresponding rows is lost. I tried numerous other
solutions (such as to "paste" back the old rownames), to no avail. After a
few days, here I am. Please, if you have a moment, send a tip.

 Thanks,

 mihai


-- 
Mihai Nica
170 East Griffith Street G5
Jackson, MS 39201

	[[alternative HTML version deleted]]

