[![R-CMD-check](https://github.com/ropensci/NLMR/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/NLMR/actions) [![codecov](https://codecov.io/gh/ropensci/NLMR/branch/main/graph/badge.svg?token=MKCm2fVrDa)](https://app.codecov.io/gh/ropensci/NLMR) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/NLMR)](https://cran.r-project.org/package=NLMR) [![](http://cranlogs.r-pkg.org/badges/grand-total/NLMR)](https://cran.r-project.org/package=NLMR) [![](https://badges.ropensci.org/188_status.svg)](https://github.com/ropensci/software-review/issues/188) [![DOI:10.1111/2041-210X.13076](https://zenodo.org/badge/DOI/10.1111/2041-210X.13076.svg)](https://doi.org/10.1111/2041-210X.13076) # NLMR **NLMR** is an `R` package for simulating **n**eutral **l**andscape **m**odels (NLM). Designed to be a generic framework like [NLMpy](https://pypi.org/project/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: ``` r # 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.: ``` r 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`. ![](vignettes/README-algorithm-gallery-1.png) ## Meta - Please [report any issues or bugs](https://github.com/ropensci/NLMR/issues/new/). - License: GPL3 - Get citation information for `NLMR` in R doing `citation(package = 'NLMR')` - We are very open to contributions - if you are interested check out our [Contributor Guidelines](CONTRIBUTING.md). - Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms. [![ropensci_footer](https://ropensci.org/public_images/github_footer.png)](https://ropensci.org/)