One great thing about the sf package is that you can use tidyverse tools like dplyr to join and manipulate the spatial data in the same way you work with non-spatial data frames in R. You can use the stread() function to import many spatial file formats like KML, GeoJSON, and shapefiles into R. Myshp = readOGR(shp, layer = basename(strsplit(shp, "\\. The sf package is a really great way to work with spatial data in R.
Here, I simply mapped a polygon shapefile using Google Satellite Imagery as a basemap. The following example borrows heavily from two R-bloggers blogs ( blog 1 and blog 2). For reading and writing vector and raster data in R, the three primary packages youll use are: sf or rgdal for vector formats such as ESRI Shapefiles. As handy as R is for so many tasks, it is important to remember that 1) R is not a GIS and 2) quality mapping is downright difficult compared to creating maps with QGIS or ArcGIS.