import_maxent: Import a Maxent model as a MaxEnt object

Description Usage Arguments Value Examples

View source: R/import_maxent.R

Description

Create a MaxEnt object from a previously-fitted Maxent model

Usage

1
import_maxent(dir, lambdas, html)

Arguments

dir

The file path to the directory containing Maxent output.

lambdas

The name of the .lambdas file representing the fitted model (e.g. 'species.lambdas'), excluding the containing path. If not provided, the first (alphabetically) .lambdas file found in dir will be used.

html

The name of the .html file containing reported Maxent results (e.g. 'maxent.html'), excluding the containing path. If not provided, the first (alphabetically) .html file found in dir will be used.

Value

A MaxEnt object (see dismo::MaxEnt).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Below we use the dismo::maxent example to fit a Maxent model:
library(dismo)
if (require(dismo) && require(rJava) && 
    file.exists(system.file('java/maxent.jar', package='dismo'))) {
  predictors <- stack(list.files(
    file.path(system.file(package='dismo'), 'ex'), '\\.grd$', full=TRUE))
  occ <- read.csv(file.path(system.file(package="dismo"), 'ex/bradypus.csv'))[, -1]
  d <- file.path(tempdir(), 'demo')
  dir.create(d)
  m1 <- maxent(predictors, occ, factors='biome', path=d)
  m2 <- import_maxent(d)
}

johnbaums/rmaxent documentation built on July 3, 2020, 5:36 p.m.