powered by
Divide SpatialLines dataset into regular segments
line_segment(l, n_segments, segment_length = NA)
A SpatialLinesDataFrame
The number of segments to divide the line into
The approximate length of segments in the output (overides n_segments if set)
# NOT RUN { data(routes_fast) l = routes_fast[2, ] library(sp) l_seg2 = line_segment(l = l, n_segments = 2) plot(l_seg2, col = l_seg2$group, lwd = 50) # }
Run the code above in your browser using DataLab