Skip to contents

NLMR is an R package for simulating neutral landscape models (NLM). Designed to be a generic framework like NLMpy, it leverages the ability to simulate the most common NLM that are described in the ecological literature. NLMR builds on the advantages of the terra package and returns all simulations as SpatRaster objects, thus ensuring direct compatibility with common GIS tasks and a flexible and simple usage. Furthermore, it simulates NLMs within a self-contained, reproducible framework.

Installation

NLMR is currently not available on CRAN. The only way to install NLMR at the moment is:

# install.packages("remotes")
remotes::install_github("ropensci/NLMR")

Example

Each neutral landscape model is simulated with a single function (all starting with nlm_) in NLMR, e.g.:

random_cluster <- NLMR::nlm_randomcluster(nrow = 100,
                                          ncol = 100,
                                          p    = 0.5,
                                          ai   = c(0.3, 0.6, 0.1),
                                          rescale = FALSE)

random_curdling <- NLMR::nlm_curds(curds = c(0.5, 0.3, 0.6),
                                   recursion_steps = c(32, 6, 2))


midpoint_displacememt <- NLMR::nlm_mpd(ncol = 100,
                                       nrow = 100,
                                       roughness = 0.61)

Overview

NLMR supplies 15 NLM algorithms, with several options to simulate derivatives of them. The algorithms differ from each other in spatial auto-correlation, from no auto-correlation (random NLM) to a constant gradient (planar gradients):

Function description reference
nlm_percolation Binary landscapes from thresholded random draws. Gardner et al. (1989)
nlm_neigh Categorical landscapes shaped by neighbourhood effects. Scherer et al. (2016)
nlm_randomcluster Nearest-neighbour random clusters. Saura and Martinez-Millan (2000)
nlm_randomrectangularcluster Overlapping rectangular clusters. Gustafson and Parker (1992)
nlm_gaussianfield Spatially correlated Gaussian random fields. Schlather et al. (2015)
nlm_curds Recursive curdling with optional wheying. O’Neill, Gardner, and Turner (1992); Keitt (2000)
nlm_fbm Fractional Brownian motion surfaces. Schlather et al. (2015)
nlm_mpd Midpoint displacement surfaces. Peitgen and Saupe (1988)
nlm_distancegradient Distance gradients measured from a rectangular origin. Etherington, Holland, and O’Sullivan (2015)
nlm_edgegradient Directional gradients with a central peak. Travis and Dytham (2004); Schlather et al. (2015)
nlm_planargradient Linear gradients in a specified or random direction. Palmer (1992)
nlm_random Independent random values drawn for each cell. With and Crist (1995)
nlm_mosaicfield Mosaic random fields generated by repeated bisection. Schlather et al. (2015)
nlm_mosaicgibbs Inhibited point-pattern tessellations. Gaucherel (2008), Method 2
nlm_mosaictess Voronoi tessellations from random seed points. Gaucherel (2008), Method 1

Algorithm examples

Example outputs for the algorithms implemented in NLMR.

Meta