R/extras.R
midpoints.Rd
Returns the midpoints between the elements of a vector in the order the elements appear.
midpoints(x)
A numeric vector with at least 2 elements.
A numeric vector of length length(x) - 1.
length(x) - 1
This function does not sort.
midpoints(c(0, 1, 10, 4)) #> [1] 0.5 5.5 7.0