which.bin: Determining the distance bin

View source: R/which.bin.R

which.binR Documentation

Determining the distance bin

Description

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".

Usage

which.bin(dis.data, cutpoints)

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)

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).

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.


lindesaysh/MRSea documentation built on April 5, 2024, 4:39 p.m.