Neighbourhood matrix

The basic (B) format uses its input as-is: binary!

nb2mat(nb1, style = "B")[1:4, 1:7]
##   [,1] [,2] [,3] [,4] [,5] [,6] [,7]
## 1    0    1    1    0    0    0    0
## 2    1    0    1    1    0    0    0
## 3    1    1    0    1    1    0    0
## 4    0    1    1    0    1    0    0