RamerDouglasPeucker {RDP} | R Documentation |
Simplify a curve using the Ramer-Douglas-Peucker algorithm.
Description
Implements the Ramer-Douglas-Peucker algorithm for reducing the number of points on a curve.
Usage
RamerDouglasPeucker(x, y, epsilon, keep_index = FALSE)
Arguments
x |
|
y |
|
epsilon |
|
keep_index |
|
Details
If there are no more than two points it does not make sense to simplify.
In this case the input is returned without further checks of x
and y
.
In particular, the input is not checked for NA
values.
Value
A data.frame
with x
and y
values of the simplified curve.
Examples
RDP::RamerDouglasPeucker(x = c(0, 1, 3, 5), y = c(2, 1, 0, 1), epsilon = 0.5)
RDP::RamerDouglasPeucker(x = c(0, 1, 3, 5), y = c(2, 1, 0, 1), epsilon = 0.5, keep_index = TRUE)
[Package RDP version 0.3.0 Index]