Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45b9391
commit 4b6332d
Showing
10 changed files
with
83 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
Package: RDP | ||
Title: The Ramer-Douglas-Peucker Algorithm | ||
Version: 0.2.3 | ||
Version: 0.3.0 | ||
Authors@R: person("Robert", "Dahl Jacobsen", role = c("aut", "cre"), email = "cran@dahl-jacobsen.dk") | ||
Description: Pretty fast implementation of the Ramer-Douglas-Peucker algorithm for reducing the number of points on a 2D curve. | ||
Urs Ramer (1972), "An iterative procedure for the polygonal approximation of plane curves" <doi:10.1016/S0146-664X(72)80017-0>. | ||
David H. Douglas and Thomas K. Peucker (1973), "Algorithms for the Reduction of the Number of Points Required to Represent a Digitized Line or its Caricature" <doi:10.3138/FM57-6770-U75U-7727>. | ||
License: GPL-3 | ||
URL: https://github.com/robertdj/RDP | ||
Encoding: UTF-8 | ||
RoxygenNote: 7.1.2 | ||
RoxygenNote: 7.2.1 | ||
LinkingTo: Rcpp | ||
Imports: Rcpp | ||
Suggests: testthat, withr, zeallot | ||
NeedsCompilation: yes | ||
Packaged: 2022-03-17 19:33:52 UTC; robert | ||
Packaged: 2023-07-05 21:57:55 UTC; robert | ||
Author: Robert Dahl Jacobsen [aut, cre] | ||
Maintainer: Robert Dahl Jacobsen <cran@dahl-jacobsen.dk> | ||
Repository: CRAN | ||
Date/Publication: 2022-03-17 20:00:02 UTC | ||
Date/Publication: 2023-07-05 22:13:04 UTC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
65121eeca10f7955916a9cb86033d11b *DESCRIPTION | ||
307eea5b522c518f3280336a284b13c0 *DESCRIPTION | ||
a6892181c742d67c91932b7a9ae9a1b1 *NAMESPACE | ||
94346c4beb59f83a249106424ee7124d *R/RDP-package.R | ||
0c1d68865f8d1fd242be2afd2091e969 *R/RcppExports.R | ||
3da93c72d3d6fdfc2deb8dd51ff28bd9 *build/partial.rdb | ||
15d2f288101747e10c53c61e3decd507 *R/RcppExports.R | ||
0c6ad5b3446721162c89589e8077ab1c *build/partial.rdb | ||
537e8955e966c4fcaa06a6403b734a66 *man/RDP-package.Rd | ||
e64af47a563757357d5238467d7bb2f3 *man/RamerDouglasPeucker.Rd | ||
5bd1528059d024806f80b6d56c6ef48f *man/RamerDouglasPeucker.Rd | ||
f83ff26c302dc4420b1b693e49719072 *man/figures/README-example-1.png | ||
daf246d2559a7df53698b1714f020b7a *src/Makevars | ||
daf246d2559a7df53698b1714f020b7a *src/Makevars.win | ||
e337a01300ab4bf35b015446439090f2 *src/RamerDouglasPeucker.cpp | ||
561f9103c77931ac481416cdec955565 *src/RamerDouglasPeucker.h | ||
717ec3dc1097c9e3ba69583eb232b940 *src/RcppExports.cpp | ||
796697c13da38f09a8b87ed424015e50 *src/wrapper.cpp | ||
a6a086927824b68da0ac55607f7c2c32 *src/RamerDouglasPeucker.cpp | ||
d8ae92e21747cce3bdc3af0ccb344dbc *src/RamerDouglasPeucker.h | ||
de56ffc5ab7fd9bf89c22c53f2cf6030 *src/RcppExports.cpp | ||
e6aca099b9b0b57001bed47704555043 *src/wrapper.cpp | ||
be8c94f200a61296bfa381fb42c8f65e *tests/testthat.R | ||
1abbbeb5341fb797ac8bca4b2f7f0368 *tests/testthat/test-RamerDouglasPeucker.R | ||
e6e1b02af05aa76515b04acf8849507e *tests/testthat/test-RamerDouglasPeucker.R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
# Generated by using Rcpp::compileAttributes() -> do not edit by hand | ||
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 | ||
|
||
#' Ramer-Douglas-Peucker | ||
#' Simplify a curve using the Ramer-Douglas-Peucker algorithm. | ||
#' | ||
#' The [Ramer-Douglas-Peucker algorithm](https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm) for reducing the number of points on a curve. | ||
#' Implements the [Ramer-Douglas-Peucker algorithm](https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm) for reducing the number of points on a curve. | ||
#' | ||
#' @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. | ||
#' | ||
#' @param x The `x` values of the curve as a vector. | ||
#' @param y The `y` values of the curve as a vector. | ||
#' @param epsilon The threshold for filtering outliers from the simplified curve. | ||
#' @param x `[numeric]` The `x` values of the curve as a vector without `NA` values. | ||
#' @param y `[numeric]` The `y` values of the curve as a vector without `NA` values. | ||
#' @param epsilon `[positive numeric(1)]` The threshold for filtering outliers from the simplified curve. | ||
#' @param keep_index `[logical]` If `TRUE`, returns a column called `index` with the index locations of points that are kept. | ||
#' | ||
#' @return 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) | ||
#' | ||
#' @export | ||
#' | ||
RamerDouglasPeucker <- function(x, y, epsilon) { | ||
.Call(`_RDP_RamerDouglasPeucker`, x, y, epsilon) | ||
RamerDouglasPeucker <- function(x, y, epsilon, keep_index = FALSE) { | ||
.Call(`_RDP_RamerDouglasPeucker`, x, y, epsilon, keep_index) | ||
} | ||
|
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters