For a vector of perpendicular (or radial) distances, this function determines which distance bin it belongs to
(given the input of cut points) and adds the beginning and end points of the respective distance bins in new colunns
in dis.data
called "distbegin" and "distend".
Arguments
- dis.data
A data frame with distance data for which perpendicular (or radial) distances are recorded in the
distance
column- cutpoints
A vector of cut points of the intervals (this function is not set up to deal with left-truncation)
Value
The dis.data
data frame to which columns "distbegin" and "distend" were added giving the beginning and end cutpoints
of the bin that the respective dis.data$distance
belongs to.
Details
If a value in dis.data$distance
matches a cut point in cutpoints
exactly, the value of dis.data.re$distance
will be attributed to the bin that is closer to the line/point unless the value of dis.data.re$distance
is 0.
E.g. if cutpoints=c(0,1,2,3)
, dis.data$distance
=2 will be attributed to interval 2 (and not 3).