Skip to content

Commit

Permalink
SSDM 0.2.5.9001 #36 and #49 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainschmitt committed Jun 14, 2019
1 parent 48c4648 commit d858afd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 18 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
NEWS
================

SSDM 0.2.5.9001
===============

- #36 and #49 fixed

SSDM 0.2.5.9000
===============

Expand Down
4 changes: 2 additions & 2 deletions R/PA.select.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ setMethod('PA.select', "Algorithm.SDM", function(obj, Env, PA = NULL, verbose =
}

# Mask defining
if (PA$strat == '2nd') {
if(verbose) {cat(' second far selection \n')}
if (PA$strat == 'disk') {
if(verbose) {cat(' disk selection \n')}
circles = list()
for (i in seq_len(length(obj@data$X))) {
x = obj@data$X[i]
Expand Down
14 changes: 1 addition & 13 deletions R/project.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,8 @@ setMethod("project", "Algorithm.SDM", function(obj, Env, ...) {
factors[sapply(factors, is.null)] <- NULL
names(factors) <- unlist(sapply(seq_len(length(Env@layers)), function(i)
if(Env[[i]]@data@isfactor) names(Env[[i]])))
if(length(factors)==0) factors <- NULL
proj = suppressWarnings(raster::predict(Env, model, factors = factors))
# proj = suppressWarnings(raster::predict(Env, model, fun = function(model,
# x) {
# x = as.data.frame(x)
# for (i in seq_len(length(Env@layers))) {
# if (Env[[i]]@data@isfactor) {
# x[, i] = as.factor(x[, i])
# x[, i] = droplevels(x[, i])
# levels(x[, i]) = Env[[i]]@data@attributes[[1]]$ID
# }
# }
# return(predict(model, x))
# }))
# Rescaling projection
proj = reclassify(proj, c(-Inf, 0, 0))
if(all(obj@data$Presence %in% c(0,1))) # MEMs should not be rescaled
if(proj@data@max > 0) proj = proj / proj@data@max
Expand Down
4 changes: 1 addition & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ There were no NOTEs, ERRORs or WARNINGs.
## Resubmission
This is a resubmission. In this version I have:

* Fixed dependency compatibility with raster 2.9-5
* Changed maintainter mail adress (permanent adress)
* Removed rgdal from vignette builder as asked by mail
* Fixed a major bug from version 0.2.4 due to dependency compatibility with raster 2.9-5

0 comments on commit d858afd

Please sign in to comment.