ropensci/landscapetools

Name: landscapetools

Owner: rOpenSci

Description: ? R package for some of the less-glamorous tasks involved in landscape analysis ?

Created: 2018-03-15 13:41:56.0

Updated: 2018-03-26 13:19:56.0

Pushed: 2018-03-26 13:59:13.0

Homepage: https://ropensci.github.io/landscapetools/

Size: 13015

Language: R

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Travis build status Build status codecov lifecycle CRAN status

landscapetools

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

util_plot: Plot a Raster* object with the landscapetools default theme (as ggplot).
util_facetplot: Plot 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.
util_import_roboto_condensed: Import Roboto Condensed font for theme_nlm.

Installation

You can install the development version from GitHub with:

stall.packages("devtools")
ools::install_github("ropensci/landscapetools")
Usage
ary(NLMR)
ary(landscapetools)
eate an artificial landscape
raster <- nlm_fbm(ncol = 200, nrow = 200, fract_dim = 0.8)
_plot(nlm_raster)

Utilities
Binarize
narize the map into habitat and matrix
rized_raster <- util_binarize(nlm_raster, breaks = 0.31415)
_plot(binarized_raster, discrete = TRUE)

Classify
assify the map into land uses
sified_raster <- util_classify(nlm_raster,
                               c(0.5, 0.25, 0.25),
                               level_names = c("Land Use 1", "Land Use 2", "Land Use 3"))
_plot(classified_raster, discrete = TRUE)

Merge
eate a primary and two secondary maps
 <- nlm_edgegradient(ncol = 100, nrow = 100)

 <- nlm_distancegradient(ncol = 100, nrow = 100,
                         origin = c(10, 10, 10, 10))

 <- nlm_random(ncol = 100, nrow = 100)

rge all maps into one
 <- util_merge(prim, c(sec1, sec2), scalingfactor = 1)

ot an overview
e_vis <- list(
"1) Primary" = prim,
"2) Secondary 1" = sec1,
"3) Secondary 2" = sec2,
"4) Result" = merg

_facetplot(merge_vis)

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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.