*_discrete_finite finds discrete values from a finite set of possibilities. *_discret_natural finds discrete values amongst the natural numbers (including 0).

next_discrete_finite(x, from, n, include_from)

prev_discrete_finite(x, from, n, include_from)

next_discrete_natural(from, n, include_from)

prev_discrete_natural(from, n, include_from)

Arguments

x

A vector of all possible discrete values.

from

Reference values.

n

Number of discrete values to find.

include_from

Logical; should the from value be included in the query? Should the to value?