I NEED Help with this spatial polygon problems (REALLY) Thanks really thanks
On Wed, 1 Apr 2009, gianni lavaredo wrote:
Hey All,
I have this problem and I need really help to understand (my limit) . I have
a polygon shape file and I need to calculate some index and select the
polygon with correct index value. I DID this with library(PBSmapping), but I
need to obtain new polygon shapefile
singleGap <- readOGR(".", "singleGap")
# Convert the SpatialPolygonDataFrame into a PolySet object for
compatibility
# with the so that PBSMapping package's geospatial functions
singleGapPBS <- SpatialPolygons2PolySet(singleGap)
# Calcula AREA
singleGap.area <- calcArea(singleGapPBS)
str(singleGap.area)
# Calcula PERIMETER
singleGap.perimeter <- calcLength(singleGapPBS)
str(singleGap.perimeter)
singleGap.Index <-
data.frame(singleGap.area[,c(1,3)],singleGap.perimeter[,3])
names(singleGap.Index)[3] = "perimeter"
str(singleGap.Index)
Which says what? Is singleGap.Index[[1]] named area? Is it a vector or a data frame? I think that singleGap.Index isn't what you think it is, meaning that singleGap.Index$area is NULL, and subsetting will not work. Roger
singleGap.Index <- singleGap.Index[singleGap.Index$area >= 5 |singleGap.Index$area < 1000,] NOW I TRYING SEVERAL METHOD BUT NOTHING. Thank, really thanks Gianni [[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no