Skip to content
Prev 325462 / 398503 Next

Reading shape files in R

jickngea alexand <jickneba <at> yahoo.ie> writes:
not able
work directory.? Here are my
border=OGR("border.shp","border"). What does it
Yes, read the help files for the function you are using, and try out the
examples using shapefiles provided with the package. If still in doubt, look
at the OGR formats page to see how OGR reads shapefiles:

http://www.gdal.org/ogr/drv_shapefile.html

where you also need dsn and layer arguments. Almost certainly:

ogrListLayers(".")

will list the shapefile layers in your working directory, and 

border=OGR(".", "border")

will read the file if it is complete. Always also include the output of
sessionInfo() in questions, as the answer may depend on the version(s) of
package(s) - here rgdal, but not mentioned by you. Even better, give a
worked example of your problem - in constructing the question, you would
certainly have answered it yourself.

Other questions on spatial and spatio-temporal matters may be answered
faster on R-sig-geo.
cannot open the connection In
".dbf", sep = ""),  : cannot
Only post plain text!

Roger