[R-sig-Geo] Get importance variables in dismo package

Ahmadou Dicko dicko.ahmadou at gmail.com
Mon Oct 10 10:48:56 CEST 2016


Hi Fabrice,

If you want to access variable contribution from a MaxEnt model, you can
use still use the plot method.

var_imp <- plot(me)
var_imp

Or build you own function based on the code of the plot method

var_contrib <- function(m, df = TRUE, ...) {
  stopifnot(inherits(m,  "MaxEnt"))
  res <- m at results[grep("contribution", rownames(m at results)), ]
  names(res) <- gsub(".contribution", "", names(res))
  if (df)
    res <- data.frame(var = names(res), contrib = unname(res))
  res
}

var_contrib(me)

Hope it helps





On Mon, Oct 10, 2016 at 10:15 AM, Fabrice Vinatier <
fabrice.vinatier.pro at gmail.com> wrote:

> Dear list members (and especially Robert J. Hijmans),
>
> I am actually using the excellent "dismo" package for flora species
> distribution modelling, and I am wondering if there is a way to get
> importance of variables used in maxent, domain, mahal and bioclim
> functions, to handle these importances in a table.
>
> I tested all possible models included in https://cran.r-project.org/web
> /packages/dismo/vignettes/sdm.pdf and I get easily the importance of
> variables issued from Random Forest, GLM and RPART models using
> "$importance", "$coefficients[-1], and "$variable.importance",
> respectively, but it is more difficult to get the others, although there is
> a possible indirect access to the importance variable of Maxent model using
> plot(me) (if me is the fitted model).
>
> Best regards,
>
> Fabrice Vinatier
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Ahmadou H. DICKO, PhD
Data hacker and climate change economist
Post-doctoral researcher
CIRAD - UMR15 CIRAD/INRA Control of exotic and emerging diseases
email : ahmadou-hamady.dicko at cirad.fr <ahmadou.dicko at ucad.edu.sn>
twitter : @dickoah
github : github/dickoa <https://github.com/dickoa>
portable: +33 7 68 16 11 58

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list