I am reading in a shape file using read.shape() I would like to select some of the polygons in the shape file, depending on data in the att.data ... but for some (probably simple) reason, it doesn't work. having read the shape file into the object nw, I would believe that nw2=nw[nw$att.data$FTEMA>0,] would select those polygons with FTEMA>0 but it give sme the error "incorrect number of dimentions" removing the last , I think I get the selection I wants, but what it returns is no longer a map object... Any clues anywhere? -- Morten Sickel Norwegian Radiation Protection Authority tel (+47) 6716 2551
Select polygons
3 messages · Morten Sickel, Edzer Pebesma
The "new style" way of doing this, using the classes of package sp, would be reading the shape with readOGR (in package rgdal), and then selecting by nw2 = nw[nw$FTEMA>0, ] -- Edzer
Morten Sickel wrote:
I am reading in a shape file using read.shape() I would like to select some of the polygons in the shape file, depending on data in the att.data ... but for some (probably simple) reason, it doesn't work. having read the shape file into the object nw, I would believe that nw2=nw[nw$att.data$FTEMA>0,] would select those polygons with FTEMA>0 but it give sme the error "incorrect number of dimentions" removing the last , I think I get the selection I wants, but what it returns is no longer a map object... Any clues anywhere? -- Morten Sickel Norwegian Radiation Protection Authority tel (+47) 6716 2551
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Edzer Pebesma Institute for Geoinformatics (IfGI) University of M?nster http://ifgi.uni-muenster.de/
Great! Thanks, that did it! Morten -----Original Message----- From: Edzer Pebesma [mailto:edzer.pebesma at uni-muenster.de] Sent: Friday, July 04, 2008 4:51 PM To: Morten Sickel Cc: r-sig-geo at stat.math.ethz.ch Subject: Re: [R-sig-Geo] Select polygons The "new style" way of doing this, using the classes of package sp, would be reading the shape with readOGR (in package rgdal), and then selecting by nw2 = nw[nw$FTEMA>0, ] -- Edzer
Morten Sickel wrote:
I am reading in a shape file using read.shape() I would like to select some of the polygons in the shape file, depending on data in the att.data ... but for some (probably simple) reason, it doesn't work. having read the shape file into the object nw, I would believe that nw2=nw[nw$att.data$FTEMA>0,] would select those polygons with FTEMA>0 but it give sme the error "incorrect number of dimentions" removing the last , I think I get the selection I wants, but what it returns is no longer a map object... Any clues anywhere?