Skip to content

Commit

Permalink
Merge pull request #371 from sjevelazco/occfilt_geo
Browse files Browse the repository at this point in the history
new argument in occfilt_geo
  • Loading branch information
sjevelazco authored Mar 13, 2024
2 parents 6be53e3 + 5af7e80 commit ee82c89
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 31 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# flexsdm 1.3.5

- occfilt_geo has a new argument "rep" to control number o repetition to filter occurrences

# flexsdm 1.3.4

- rgeos was removed from dependencies [#356](https://github.com/sjevelazco/flexsdm/pull/356)
Expand Down
9 changes: 5 additions & 4 deletions R/occfilt_geo.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#' }
#' @param prj character. Projection string (PROJ4) for occurrences. Not necessary if
#' the projection used is WGS84 ("+proj=longlat +datum=WGS84"). Default "+proj=longlat +datum=WGS84"
#' @param reps integer. Number of times to repeat the thinning process. Default 20
#'
#' @return
#' A tibble object with data filtered geographically
Expand Down Expand Up @@ -127,7 +128,7 @@
#'
#' @seealso \code{\link{occfilt_env}}
#'
occfilt_geo <- function(data, x, y, env_layer, method, prj = "+proj=longlat +datum=WGS84") {
occfilt_geo <- function(data, x, y, env_layer, method, prj = "+proj=longlat +datum=WGS84", reps = 20) {
da <- data0 <- data
rm(data)
da <- da[c(x, y)]
Expand Down Expand Up @@ -223,7 +224,7 @@ occfilt_geo <- function(data, x, y, env_layer, method, prj = "+proj=longlat +dat
long.col = x,
spec.col = ".spp",
thin.par = d,
reps = 20,
reps = reps,
write.files = FALSE,
locs.thinned.list.return = TRUE,
write.log.file = FALSE
Expand Down Expand Up @@ -263,7 +264,7 @@ occfilt_geo <- function(data, x, y, env_layer, method, prj = "+proj=longlat +dat
long.col = x,
spec.col = ".spp",
thin.par = distance,
reps = 20,
reps = reps,
write.files = FALSE,
locs.thinned.list.return = TRUE,
write.log.file = FALSE
Expand Down Expand Up @@ -294,7 +295,7 @@ occfilt_geo <- function(data, x, y, env_layer, method, prj = "+proj=longlat +dat
long.col = x,
spec.col = ".spp",
thin.par = as.numeric(method["d"]),
reps = 20,
reps = reps,
write.files = FALSE,
locs.thinned.list.return = TRUE,
write.log.file = FALSE
Expand Down
4 changes: 4 additions & 0 deletions docs/news/index.html

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

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ articles:
v04_Red_fir_example: v04_Red_fir_example.html
v05_Rare_species_example: v05_Rare_species_example.html
v06_Extrapolation_example: v06_Extrapolation_example.html
last_built: 2024-01-16T20:03Z
last_built: 2024-03-13T13:14Z
urls:
reference: https://sjevelazco.github.io/flexsdm/reference
article: https://sjevelazco.github.io/flexsdm/articles
Expand Down
11 changes: 5 additions & 6 deletions docs/reference/env_outliers.html

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

Loading

0 comments on commit ee82c89

Please sign in to comment.