Description Usage Arguments Value See Also Examples

Find integers within some radius of the given ones.

1 | ```
neighbours(k, x = 1:max(k), r = 0)
``` |

`k` |
integers within whose neighbourhood to look |

`x` |
allowed integers |

`r` |
radius within which to look |

Returns those integers in `x`

which are at most `r`

from some integer in `k`

, i.e. the intersection of `x`

with the union of the balls of radius `r`

centred at the values of `k`

. The return values are unique and sorted.

`is.element`

, `match`

, `findInterval`

, `stepcand`

1 2 | ```
neighbours(c(10, 0, 5), r = 1)
neighbours(c(10, 0, 5), 0:15, r = 1)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.