On Aug 17, 2013 4:21 PM, "sara martino" <saramartino@yahoo.com> wrote:
>
> Hi
> i am new to using shapefiles in R. I just want to plot some maps and I
used to do it as:
>
>
> shp=readShapeSpatial("file.shp")
> plot(shp)
>
> using maptools or
>
>
> shp <-readOGR("path/to/shpfiles","IND_adm2")plot(shp)
>
> using rgdal.
>
> I have now upgraded to R 3.0.1 and since then everytime i try to plot the
shapefile i get the error:
>
> Error in as.double(y) :
> cannot coerce type 'S4' to vector of type 'double'
>
> I get the same error also if i try to reproduce the example in
>?readShapeSpatial.
>
> Can anyone tell me what is the problem?
> thanks
> sara

Sara,

I ran into a similar problem when I upgraded, and in my case the problem
was that rgdal was compiled against an old version of GDAL. CRAN specifies
GDAL >= 1.6.3, but I would recommend compiling rgdal against the most
recent GDAL you can install.

Output of Sys.info() and library(rgdal) would be helpful.

Best,
--Lee

	[[alternative HTML version deleted]]

