which.bin | R Documentation |
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".
which.bin(dis.data, cutpoints)
dis.data |
A data frame with distance data for which perpendicular (or radial) distances are recorded in the |
cutpoints |
A vector of cut points of the intervals (this function is not set up to deal with left-truncation) |
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).
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.