Given a vector of interval endpoints breaks, determine in which intervals the elements of a vector x fall.

find_interval(x, breaks, rightmost_closed, all_inside)

Arguments

x

vector for whose elements the corresponding intervals are identified

breaks

vector containing the elements

rightmost_closed

logical; if true, the results for x[j]=breaks[N] is N-1.

all_inside

logical; if true, 0 is mapped to 1, and N is mapped to N-1

The rightmost interval is assumed to be closed. Compares to the behavior of the findInterval function in R, when rightmost.closed = TRUE

Value

matrix containing the compartment counts at census times.