From d858afd15fbd7f00f39519bb591394ec847ae14e Mon Sep 17 00:00:00 2001 From: sylvainschmitt Date: Fri, 14 Jun 2019 13:25:55 +0200 Subject: [PATCH] SSDM 0.2.5.9001 #36 and #49 fixed --- NEWS.md | 5 +++++ R/PA.select.R | 4 ++-- R/project.R | 14 +------------- cran-comments.md | 4 +--- 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/NEWS.md b/NEWS.md index 85944b4..330e2e0 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,11 @@ NEWS ================ +SSDM 0.2.5.9001 +=============== + +- #36 and #49 fixed + SSDM 0.2.5.9000 =============== diff --git a/R/PA.select.R b/R/PA.select.R index cee14e1..0252fad 100755 --- a/R/PA.select.R +++ b/R/PA.select.R @@ -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] diff --git a/R/project.R b/R/project.R index 457766a..e310040 100755 --- a/R/project.R +++ b/R/project.R @@ -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 diff --git a/cran-comments.md b/cran-comments.md index 98dd42c..7845aaa 100755 --- a/cran-comments.md +++ b/cran-comments.md @@ -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