Having a polygon shapefile, I need to produce a polyline shapefile containing only the common borders between polygons (see the picture).
My question is similar to 1 and 2, only I need to do this in R
. The latter similar question refers to a solution with the use of Shapely
package for python
. The analogue of Shapely
for R
is rgeos
. Though, I couldn't find the solution with rgeos
on my own.
Note: the shapefile with borders used for illustration was produced in ArcGIS using the solution from similar question 1. Now I need to do the same in R
.