문제

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!

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top