Question

I am using maptools to open a shapefile in R, but I get the following error in Rstudio:

library(maptools)
basins = readShapeSpatial("H:GIS/shapefiles/basins")
Error in getinfo.shape(fn) : Error opening SHP file

When I try the exact same code in RGui (instead of Rstudio) it works! I would like to keep using Rstudio as it is so convenient so anybody know how to fix this problem?

Thanks!

Was it helpful?

Solution

I can't answer as to why it works in Rstudio, but the issue is that your drive path / drive name is non-standard

 'H:/GIS/shapefiles/basins'

is more standard, and works in both.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top