# you need to have installed sf package
library(sf)
### Working Directory in my system specifying where the file is
### note that the name tl_2025_us_county is part of the file path and the ### name of the file itself.
wd<-'C:/Users/rm84/OneDrive - Texas State University/Desktop/teaching/3339/Maps_files/tl_2025_us_county'
setwd(wd)
### Read in the shp file but note that the st_read function uses shx dbf ### and the prj file in addition to the shp file.
counties <- st_read("tl_2025_us_county.shp")Reading layer `tl_2025_us_county' from data source
`C:\Users\rm84\OneDrive - Texas State University\Desktop\teaching\3339\Maps_files\tl_2025_us_county\tl_2025_us_county.shp'
using driver `ESRI Shapefile'
Simple feature collection with 3235 features and 18 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: -179.2311 ymin: -14.60181 xmax: 179.8597 ymax: 71.43979
Geodetic CRS: NAD83