Tuesday, August 4, 2015

Tutorials on Maxent and ENMTools

A few months ago, I gave a workshop at James Cook University in Townsville, Australia.  We covered some basic concepts for niche modeling and ecological biogeography, and then ran through some sample exercises in Maxent, ENMTools, and ecospat.

First, here's a tutorial on basic ideas and procedures for niche modeling:

Then a very brief foray into the different assumptions that need to be made when using niche models for different purposes in ecological biogeography:

The main event was a two hour demo of ENMTools.  Unfortunately we had a serious issue with the recording: there was no audio at all!  I'll try to replicate the talk on my own and upload it one of these days.

For those of you who want to play along at home, the demo data is here:


I really want to thank JCU for having me out, and in particular Megan Higgie and Conrad Hoskin for their hospitality.


  1. This comment has been removed by the author.

  2. Hi Dan!
    First of all, Thank you very much for this blog and for the news! it has ben so interesting for all people that starting to deal with SDM issues. Of course for your interesting paper.
    I'm trying to deal with your ecospat R script Demo, but I guess that I'm lost.
    This part of the code not run properly in my PC:

    #Grabbing environmental data for species points
    sp.points <- points
    coordinates(sp.points) <- ~longitude+latitude
    sp.list <- levels(as.factor(sp.points$Species))
    sp.env <- extract(stack, sp.points)
    sp.env <- cbind(points, sp.env)
    sp.env <- sp.env[complete.cases(sp.env),]

    Could you support some advice and a little explanantion??

    Thank so much in advance!


  3. What error are you getting? Have you set your working directory?

    1. Hi Dan!
      I've running your interesting piece of code to ecospat (sandbox) fromyour workshop in JCU. I have a couple of questions that I've can't resolve by myself. Very appreciated if you reply me!
      first, in the data preparation I only am able to include two of my 4 variables in the stack . I have foru environamental variables (same size and number of rows and column)
      I'm using:
      dataType(stack[[1]]) <- "FLT4S"
      dataType(stack[[2]]) <- "FLT4S"
      stack[stack < -2000] <- NA

      and then I tried with dataType(stack[[3]]) and 4 to include my other two environmental variables, but is not working. Any commnet about it? is it posible to include the four variables?

      When I'm grabbing environmental data for species points
      everything is OK, except in the last line:
      eutropia.background.env <- eutropia.background.env[min.dist < maxdist,]

      When I run this line, the background.env have originally 99561 obs and 5 variables to 0 observ and five variables, it's mean the data is erasure from the df. Any idea what happen that one.
      I tried changing maxdis 0.01 to 0.1 or 0.001, but it is not working, but something happenwith the max/min functions

      Any idea what happened?
      In advance Thank you very much!!!!

  4. I got it!!
    I have a small error with the data file. It was my fault...
    I'll try to run with my own data now