Skip to content

Commit

Permalink
🐛 Fix #310
Browse files Browse the repository at this point in the history
  • Loading branch information
mhesselbarth committed Nov 30, 2023
1 parent 943d426 commit f714a61
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: landscapemetrics
Title: Landscape Metrics for Categorical Map Patterns
Version: 2.1.0
Version: 2.1.1
Authors@R: c(person("Maximilian H.K.", "Hesselbarth",
role = c("aut", "cre"),
email = "mhk.hesselbarth@gmail.com",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# landscapemetrics 2.1.0
* Bugfixes
* Bugfix in calculate of clumpy if NA calc is present

# landscapemetrics 2.1.0
* Improvements
* Many performance improvements. Most visible are in
Expand Down
2 changes: 1 addition & 1 deletion R/lsm_c_clumpy.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ lsm_c_clumpy_calc <- function(landscape, resolution, extras = NULL){
clumpy <- vapply(seq_along(g_i), FUN = function(i) {

# set to NA if mathematical not possible
if (is.nan(g_i[i]) || is.na(g_i[i]) || p_i[i] == 1) numeric(NA)
if (is.nan(g_i[i]) || is.na(g_i[i]) || p_i[i] == 1) as.numeric(NA)
# calc clumpy
else if (g_i[i] >= p_i[i]) (g_i[i] - p_i[i]) / (1 - p_i[i])
else if (g_i[i] < p_i[i] && p_i[i] >= 0.5) (g_i[i] - p_i[i]) / (1 - p_i[i])
Expand Down
3 changes: 3 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# landscapemetrics 2.1.1
Minor bugfix

# landscapemetrics 2.1.0
Larger internal updates to several algorithms

Expand Down

0 comments on commit f714a61

Please sign in to comment.