x <- runif(5) > 0.5
nb <- neighbourfun(type = "logical")
compare_vectors(x, nb(x))
## 01010
## |
## 00010
## The vectors differ in 1 place.
nb <- neighbourfun(type = "logical", stepsize = 2)
compare_vectors(x, nb(x))
## 01010
## | |
## 11011
## The vectors differ in 2 places.
Run the code above in your browser using DataLab