Creates n
segments of a line (the RD cut-off) and assigns the closest border segment for each observation in the sf data frame.
Computationally these tasks are quite demanding when the sample size is big and thus might take a few seconds to complete.
border_segment(data, cutoff, n = 10)
sf data frame containing point data
the RDD border in the form of a line (preferred) or borderpoints
the number of segments to be produced
a vector with factors, each category representing one segment