Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jmestret committed Oct 5, 2024
1 parent d73e6c5 commit fd75388
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 307 deletions.
16 changes: 5 additions & 11 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
Type: Package
Package: GeoThinneR
Title: Simple Spatial Thinning for Ecological and Spatial Analysis
Version: 1.0.0
Version: 1.1.0
Authors@R:
person("Jorge", "Mestre-Tomás", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-8983-3417"))
Description: Provides efficient geospatial thinning algorithms to reduce
the density of coordinate data while maintaining spatial
relationships. Implements K-D Tree Approximate Nearest Neighbors
(ANN), R-Tree, and brute force thinning methods. It uses a modified version
of the R-tree structure from the 'rtree' package
<https://github.com/akoyabio/rtree>. The modified version can be downloaded
from <https://github.com/jmestret/rtree>.
For more information on the methods, see
Elseberg et al. (2012) <https://hdl.handle.net/10446/86202>.
relationships. Implements K-D Tree and brute-force distance-based
thinning, as well as grid-based and precision-based thinning methods.
For more information on the methods, see Elseberg et al. (2012)
<https://hdl.handle.net/10446/86202>.
License: MIT + file LICENSE
URL: https://github.com/jmestret/GeoThinneR,
https://jmestret.github.io/GeoThinneR/
Expand All @@ -32,14 +29,11 @@ Suggests:
ggplot2,
knitr,
rmarkdown,
rtree,
sf,
testthat (>= 3.0.0),
tibble
LinkingTo:
Rcpp
Remotes:
jmestret/rtree
VignetteBuilder:
knitr
BuildVignettes: true
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# GeoThinneR (development version)

# GeoThinneR 1.1.0

* Removed non-CRAN dependency (`rtree`) and associated functions related to R-Trees structure thinning method (`r_tree_thinning()`).
* Minor improvements to documentation.

# GeoThinneR 1.0.0

* Initial release!
117 changes: 0 additions & 117 deletions R/r_tree_thinning.R

This file was deleted.

7 changes: 2 additions & 5 deletions R/thin_points.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @param long_col Name of the column with longitude coordinates (default: "decimalLongitude").
#' @param lat_col Name of the column with latitude coordinates (default: "decimalLatitude").
#' @param group_col Name of the column for grouping points (e.g., species name, year). If NULL, no grouping is applied.
#' @param method Thinning method to use `c("brute_force", "kd_tree", "r_tree", "round_hash", "grid", "precision")`.
#' @param method Thinning method to use `c("brute_force", "kd_tree", "round_hash", "grid", "precision")`.
#' @param trials Number of thinning iterations to perform (default: 10).
#' @param all_trials If TRUE, returns results of all attempts; if FALSE, returns the best attempt with the most points retained (default: FALSE).
#' @param target_points Optional; a numeric value specifying the exact number of points to keep. If NULL (default), maximizes the number of kept points.
Expand All @@ -23,7 +23,6 @@
#' The thinning methods available are:
#' - `brute_force`: Uses a brute force approach to thin points.
#' - `kd_tree`: Uses K-D trees for thinning.
#' - `r_tree`: Uses R-trees for thinning.
#' - `round_hash`: Uses rounding and hashing for efficient thinning.
#' - `grid`: Applies a grid-based thinning method.
#' - `precision`: Utilizes precision-based thinning.
Expand All @@ -32,7 +31,6 @@
#' - `brute_force_thinning()`
#' - `grid_thinning()`
#' - `kd_tree_thinning()`
#' - `r_tree_thinning()`
#' - `rounding_hashing_thinning()`
#' - `precision_thinning()`
#'
Expand Down Expand Up @@ -63,7 +61,7 @@
#'
#' @export
thin_points <- function(data, long_col = NULL, lat_col = NULL, group_col = NULL,
method = c("brute_force", "kd_tree", "r_tree", "round_hash", "grid", "precision"),
method = c("brute_force", "kd_tree", "round_hash", "grid", "precision"),
trials = 10, all_trials = FALSE,
target_points = NULL, seed = NULL, verbose = FALSE, ...) {

Expand Down Expand Up @@ -126,7 +124,6 @@ thin_points <- function(data, long_col = NULL, lat_col = NULL, group_col = NULL,
method,
"brute_force" = brute_force_thinning(coordinates, trials = trials, all_trials = all_trials, ...),
"kd_tree" = kd_tree_thinning(coordinates, trials = trials, all_trials = all_trials, ...),
"r_tree" = r_tree_thinning(coordinates, trials = trials, all_trials = all_trials, ...),
"round_hash" = rounding_hashing_thinning(coordinates, trials = trials, all_trials = all_trials, seed = seed, ...),
"grid" = grid_thinning(coordinates, trials = trials, all_trials = all_trials, ...),
"precision" = precision_thinning(coordinates, trials = trials, all_trials = all_trials, ...),
Expand Down
8 changes: 1 addition & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ To install the development version of GeoThinneR from GitHub, use:
devtools::install_github("jmestret/GeoThinneR")
```

Optionally, to use R-trees you need to install:

```r
devtools::install_github("jmestret/rtree")
```

## How to Use GeoThinneR

The documentation can be found at <https://jmestret.github.io/GeoThinneR/>. Below are some examples demonstrating how to use the package for different spatial thinning methods.
Expand Down Expand Up @@ -188,4 +182,4 @@ We welcome contributions! If you have suggestions for improvements or new featur

The GeoThinneR paper is currently in progress. Meanwhile, you can reference the GitHub repository as follows:

Mestre-Tomás, J. (2024). GeoThinneR: An R package for simple spatial thinning methods in ecological and spatial analysis. R package version 1.0.0, https://github.com/jmestret/GeoThinneR
Mestre-Tomás, J. (2024). GeoThinneR: An R package for simple spatial thinning methods in ecological and spatial analysis. R package version 1.1.0, https://github.com/jmestret/GeoThinneR
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ To install the development version of GeoThinneR from GitHub, use:
devtools::install_github("jmestret/GeoThinneR")
```

Optionally, to use R-trees you need to install:

``` r
devtools::install_github("jmestret/rtree")
```

## How to Use GeoThinneR

The documentation can be found at
Expand Down Expand Up @@ -167,4 +161,4 @@ reference the GitHub repository as follows:

Mestre-Tomás, J. (2024). GeoThinneR: An R package for simple spatial
thinning methods in ecological and spatial analysis. R package version
1.0.0, <https://github.com/jmestret/GeoThinneR>
1.1.0, <https://github.com/jmestret/GeoThinneR>
1 change: 0 additions & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ reference:
contents:
- '`brute_force_thinning`'
- '`kd_tree_thinning`'
- '`r_tree_thinning`'
- '`rounding_hashing_thinning`'
- '`grid_thinning`'
- '`precision_thinning`'
Expand Down
39 changes: 33 additions & 6 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,40 @@

This is a resubmission to address the feedback from the previous CRAN submission.

* Moved the Note to the Description field in the DESCRIPTION file as requested.
* Shortened the package title to meet the 65-character limit.
* Replaced `\dontrun{}` with `\donttest{}` for examples that can be executed.
* Wrapped examples that require packages in `Suggests` using `if(requireNamespace("pkgname", quietly = TRUE)){}` to avoid errors if those packages are not installed.
* The non-CRAN package `rtree` has been removed from `Suggests`.
* Associated functionalities depending on `rtree` have been removed or adjusted accordingly.

## Test environments

The package was tested on the following environments:

* Windows Server 2022 x64 (build 20348)
* Debian GNU/Linux trixie/sid

## R CMD check results

0 errors | 0 warnings | 1 note
The package passed `R CMD check` on all tested platforms with the following results.
There was one NOTE:

```
New submission
Package was archived on CRAN
Possibly misspelled words in DESCRIPTION:
Elseberg (12:46)
al (12:58)
et (12:55)
geospatial (8:33)
```

* This is a new submission after the package was archived.
* The flagged words in the DESCRIPTION are proper nouns or standard terminology.

```
CRAN repository db overrides:
X-CRAN-Comment: Archived on 2024-09-18 as issues were not corrected
in time.
```

* This is a new release.
* All previously noted issues have now been corrected, and the package is ready for resubmission.
60 changes: 0 additions & 60 deletions man/r_tree_thinning.Rd

This file was deleted.

6 changes: 2 additions & 4 deletions man/thin_points.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified src/GeoThinneR.dll
Binary file not shown.
Loading

0 comments on commit fd75388

Please sign in to comment.