Thursday, September 8, 2016

Small but useful change: ENMTools R package now auto-recognizes lat and lon columns

Just a quick little note to let you know that the ENMTools R package now automatically looks for columns named "x" and "y", or beginning with "lat" and "lon" as part of its pre-analysis check of the species objects.  It's a little thing, but it should prevent a lot of errors and confusion.

6 comments:

  1. Shiny!
    Although I found that when trying to run a MaxEnt model via ENMTools dismo appears to require explicit "latitude" and "longitude" headers...

    ReplyDelete
  2. I'm not sure what you mean by that. Could you give an example?

    ReplyDelete
  3. Hey Dan.
    Naturally I now can't replicate the error. It seemed to resolve when I changed the heading in my .csv from "lat" to "latitude", but I may have tweaked something else, so I guess disregard.

    Another question tho: I'm getting wildly different predictions when running Maxent via ENMTools and the GUI, am I correct in thinking that dismo (and thus ENMTools) does not invoke the same defaults as the GUI and that to obtain the same prediction I will need to pass along args?

    ReplyDelete
  4. It could be that, or it could be that either enmtools is using a different definition of "background" from Maxent. Are you using background points, the species range raster, or what?

    ReplyDelete
  5. Background points, plugging my data into your tutorial defaults while I get familiar with what's going on:

    Nth$background.points = background.points.buffer(Nth$presence.points, 20000, 1000, env[[1]])

    Running MaxEnt via the GUI (with defaults) I get a prediction map pretty much as expected, high suitability concentrated around my occurrences (coastal Aus) with zero suitability in the interior of the continent.
    Via ENMTools my occurrence points are in zero probability space, and the entire interior and north of the continent is high suitability, which is implausible.

    I am not returning any running errors, although ENMTools is not automatically generating a plot when I call for the summary (Nth.mx) and I am having to pull it up independently using "plot.enmtools.maxent(Nth.mx)"

    Any insight much appreciated (user error assumed)!
    Any ideas?

    ReplyDelete
  6. Yeah I think you may have just used too narrow a background - 20k is pretty narrow for a lot of purposes. If you want ENMTools to sample background like the Maxent GUI does, you should actually just call it without any background points at all. Give that a shot (set your Nth$background.points <- NULL) and see if you get more reasonable results.

    ReplyDelete