I am trying to read a shapefile named shapefile.shp using readOGR. I am using the following code:
shp=readOGR('C:/Users/koley/OneDrive/Desktop/My Folder 2-MK-thinkpad/Data/CL/shapefile.shp')
It gives me the following error:
Error in ogrListLayers(dsn = dsn) : Cannot open data source
I further tried using
shp=readOGR(dsn="C:\\Users\\koley\\OneDrive\\Desktop\\My Folder 2-MK-thinkpad\\Data\\CL", layer="shapefile")
And it gives me this error:
Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, :
Cannot open layer
Can someone please help me read this shapefile? I am new to working with shapefiles and unable to understand what is going wrong. Thanks in advance.