import_maxent: Import a Maxent model as a MaxEnt object

View source: R/import_maxent.R

import_maxentR Documentation

Import a Maxent model as a MaxEnt object

Description

Create a MaxEnt object from a previously-fitted Maxent model

Usage

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

# 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 Oct. 11, 2024, 11:14 a.m.