Hi Abdoulaye

Perhaps its helpful to simplify the instruction so its easy to read in ordinary text. The example that Jeffrey Hollister gives at https://www.r-bloggers.com/things-i-forget-reading-a-shapefile-in-r-with-readogr/

is like this

myShapeInR<-readOGR("C:/data","myShapeFile") where the shapefile is called myShapeFile.shp, and its in C:/data.

If its in your current working directory (calling getwd() will tell you what your current working directory is) then you can use simply

myShapeInR<-readOGR(".","myShapeFile") as the full stop "." is a symbol for the current directory.

Hope that helps

David


On 9/11/2019 2:47 am, Abdoulaye Sarr wrote:
I am trying to read a shapefile using readOGR but keep getting error
messages:
map =
readOGR(dsn=path.expand("/Volumes/DS2S/R_QGIS_codes//Data"),"indicator")
Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv =
use_iconv,  :
  Cannot open layer

What could be causing the problem? sp 1.3-2

Thanks
as

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
--
Land and Water Management logo

David Hine
Land and Water Management PL
Level 7, 127 Creek St
Brisbane, Qld 4000
Australia

m: 0429 886 146 +61 429 886 146
t: (07) 4015 3470 +61 7 4015 3470

GeoPortal with example presentations of spatial data for horticulture users and others.
Land and Water Management PL


_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to