landscapetools provides utility functions to work with landscape data (raster* Objects).
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_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.
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.
You can install the development version from GitHub with:
# Create a primary and two secondary maps prim <- nlm_edgegradient(ncol = 100, nrow = 100) sec1 <- nlm_distancegradient(ncol = 100, nrow = 100, origin = c(10, 10, 10, 10)) sec2 <- nlm_random(ncol = 100, nrow = 100) # Merge all maps into one merg <- util_merge(prim, c(sec1, sec2), scalingfactor = 1) # Plot an overview merge_vis <- list( "1) Primary" = prim, "2) Secondary 1" = sec1, "3) Secondary 2" = sec2, "4) Result" = merg ) show_landscape(merge_vis)
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.
landscapetoolsin R doing
citation(package = 'landscapetools')