As proposed by Josh O'Brien, I have used the rgeos::gRelate()
function.
I get 3 DE-9IM cases:
x <- gRelate(shapefile.1, shapefile.2, byid = TRUE)
table(x)
2FF10F212 2FF11F212 2FF1FF212
63 2470 174495
The resulted DE-9IM string codes can be interpreted as follow:
1) 2FF1FF212: represent polygons from the first shapefile that don't intersect the border of the polygon of the second shapefile
2) 2FF11F212: represent polygons from the first shapefile that intersect the border of the polygon of the second shapefile with a line
3) 2FF10F212: represent polygons from the first shapefile that intersect the border of the polygon of the second shapefile with a point
The two last cases are my border polygons that I was looking for. I have got their ID with:
poly.border <- which(x %in% c("2FF10F212","2FF11F212"))