landscapetools provides utility functions to work with landscape data (raster* Objects).

The following functions are implemented:

Utilities:

util_binarize: Binarize continuous raster values, if > 1 breaks are given, return a RasterBrick.
util_classify: Classify a raster into proportions based upon a vector of class weightings.
util_merge: Merge a primary raster with other rasters weighted by scaling factors.
util_raster2tibble, util_tibble2raster: Coerce raster* objects to tibbles and vice versa.
util_rescale: Linearly rescale element values in a raster to a range between 0 and 1.

Visualization

show_landscape: Plot a Raster* object with the landscapetools default theme (as ggplot) or multiple raster (RasterStack, -brick or list of raster) side by side as facets.

Themes:

theme_nlm, theme_nlm_grey: Opinionated ggplot2 theme to visualize raster (continuous data).
theme_nlm_discrete, theme_nlm_grey_discrete: Opinionated ggplot2 theme to visualize raster (discrete data).
theme_faceplot: Opinionated ggplot2 theme to visualize raster in a facet wrap.

Installation

You can install the development version from GitHub with:

Usage

library(NLMR)
library(landscapetools)
# Create an artificial landscape
nlm_raster <- nlm_fbm(ncol = 200, nrow = 200, fract_dim = 0.8)
show_landscape(nlm_raster)

See also

In the examples above we make heavy use of the NLMR package. Both packages were developed together until we split them into pure landscape functionality and utility tools. If you are interested in generating neutral landscapes via a multitude of available algorithms take a closer look at the NLMR package.

Meta

ropensci_footer