read_mxe: Read raster data stored in Maxent's mxe format

Description Usage Arguments Value Author(s) References See Also

Description

Read (and optionally clip) binary mxe files created by the Maxent habitat suitability modelling software package.

Usage

1
2
read_mxe(file, ext, snap = "near", chunk_size = 1e+05,
  return_raster = TRUE)

Arguments

file

The path to the mxe file to be read.

ext

(Optional) An extent to clip the grid to. This must be either an Extent object, a SpatialPolygons*, or a numeric vector with four elements in the order xmin xmax, ymin, ymax.

snap

Character. One of 'near', 'out', or 'in'. This will adjust the extent given in ext such that it aligns with the raster data being read. Note that currently, supplying 'out' or 'in' will result in the extent being expanded/contracted even if the provided extent already aligns with the grid. snap is ignored if ext is not provided.

chunk_size

A numeric value specifying the size of the chunk of binary data to be read at a time (size is usually in units of KB of data). chunk_size is ignored if ext is not provided. If clipping the imported data (i.e. if ext is provided), the raster data are read in chunks, with chunk_size values being read, and subsequently filtered to those values within the desired extent, at a time. Decreasing chunk_size leads to lower system memory demand, but also to longer processing time.

return_raster

Logical. If FALSE, then the cell values data will returned as a vector; if TRUE, a raster object will be returned.

Value

If return_raster is TRUE, a raster object. If return_raster is FALSE, a list is returned, with the following elements:

Author(s)

John B. Baumgartner, johnbaums@gmail.com

Peter D. Wilson

References

Based on "Reading mxe files with R - revisited" by Peter D. Wilson.

See Also

project_maxent


johnbaums/things documentation built on May 19, 2019, 3:03 p.m.