Description Usage Arguments Value Note See Also Examples

For each point or interval in the `from`

argument, compute the
distance to the nearest position in the `to`

argument.

1 2 3 | ```
## S4 method for signature
## 'Intervals_virtual_or_numeric,Intervals_virtual_or_numeric'
distance_to_nearest(from, to, check_valid = TRUE)
``` |

`from` |
An object of appropriate type. |

`to` |
An object of appropriate type. |

`check_valid` |
Should |

A vector of distances, with one entry per point or interval in
`from`

. Any intervals in `from`

which are either empty (see
`empty`

) or have `NA`

endpoints produce a `NA`

result.

This function is now just a wrapper for `which_nearest`

.

See `which_nearest`

, which also returns indices for the
interval or intervals (in case of ties) at the distance reported.

1 2 3 4 5 6 7 8 9 10 11 |

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.