[R] plotting texas school district using shape files

Ben Bolker bbolker at gmail.com
Wed May 25 17:10:03 CEST 2011


Shant Ch <sha1one <at> yahoo.com> writes:

> 
> Yes I had included the library(maptools) in my code, it is already
> installed in 
> my computer. but still it is showing the same error.
> 

  In that case you should (1) read the posting guide, (2) copy and
paste the code you ran, and the precise error you got, into an 
email to the list that also includes (3) the results of running
sessionInfo() during your R session (after loading the maptools
package).

  Then perhaps we will have enough information to help diagnose
the problem.

  PS: a little more poking around shows that, at least on my
system, read.shape() is *not* part of the maptools package.

help.search("read.shape")  finds maptools::readShapeSpatial.
library("sos"); findFn("read.shape") discovers that there
is a read.shape() function in the spsurvey package.

  Ben Bolker

> > I was plotting or creating a map for Texas school districts 
> > using the shape file 
> > of Texas. I could not find any other helpful mail in the mailing list.
> > 
> > txshp<-read.shape(system.file("S:\\Districts_10_11.shp", 
>>    package="maptools"))
> > 
> > Error-  read.shape no found. But read.shape is there in maptools. 
> > 
> 
>   After you have done that I suspect you will still have a problem with
> finding the file -- I think you want something like
> 
> library("maptools")
> txtshp <- read.shape("S:\\Districts_10_11.shp")
> 
>   Ben Bolker



More information about the R-help mailing list