Due to the contribution of many developers in the form of R packages, we can now use R as a spatial analysis tool to perform different operations on vector data. To master these, we need to know the basics of spatial data manipulation in R. Some R packages, such as sp, rgdal, and rgeos, will be used frequently to accomplish these tasks.
Working with vector data in R
Combining shapefiles in R
In this example, we'll merge two shapefiles of two districts called Dhaka and Gazipur. Now, BGD_adm3_data_re is a shapefile containing all of the districts of Bangladesh as separate polygons. We have the shapefile of Dhaka but not of Gazipur, so we'll create a shapefile of Gazipur before we start merging these two shapefiles...