OK, that loads the shape file. But now when I do:
submap <- subset(spb, as.character(spb$Name) == 'Vasilevsky Island') the submap still has the whole city, not just the subset. Is there now a different way of extracting a subset from a map? A 2010/11/10 Phil Spector <spec...@stat.berkeley.edu>: > Aleksandr - > What happens when you use > > library(maptools) > spb = readShapePoly('/home/sasha/Documents/maps/spb.shp') > > - Phil Spector > Statistical Computing Facility > Department of Statistics > UC Berkeley > spec...@stat.berkeley.edu > > > > On Wed, 10 Nov 2010, Aleksandr Andreev wrote: > >> A few years back, I wrote some code to plot maps with the maptools >> package. Now I am trying to reproduce my results, only to find out >> that maptools has been updated and my code no longer works. >> >> I've been able to fix the first part of it by forcing >> spb <- maptools:::read.shape("/home/sasha/Documents/maps/spb.shp") >> >> (as read.shape has been deprecated) >> >> but now when I do >> plot(spb, xlab="Longitude", ylab="Latitude", main="Map of St >> Petersburg, Russia") >> >> I get the message >> Error in xy.coords(x, y, xlabel, ylabel, log) : >> 'x' is a list, but does not have components 'x' and 'y' >> >> What's the new syntax that I'm supposed to use? >> >> I'm using R version 2.12.0 (2010-10-15) on x86_64-pc-linux-gnu (64-bit) >> >> Thanks, >> >> ------------------------ >> Aleksandr Andreev >> Graduate Student - Department of Economics >> University of North Carolina at Chapel Hill >> Mobile: +1 303 507 93 88 >> Skype: typiconman >> >> ______________________________________________ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.