How to open shapefile in Rstudio

Hi all,

How to open shapefile in R, and see the attributes like in ArcMap? My ArcMap has crashed so I decided to use R. I use the code below, but it creates no figure. Thanks for your help.

exam <- getinfo.shape("myfile.shp")
str(exam)
print(exam)

This thread from GIS stack exchange should help!

There's also a nice tutorial from data carpentry, "Open and Plot Shapefiles in R" that might help as well
https://datacarpentry.org/r-raster-vector-geospatial/06-vector-open-shapefile-in-r/

2 Likes