Coder Social home page Coder Social logo

ropensci / landscapetools Goto Github PK

View Code? Open in Web Editor NEW
46.0 13.0 16.0 22.17 MB

๐Ÿ“ฆ R package for some of the less-glamorous tasks involved in landscape analysis ๐ŸŒ

Home Page: https://docs.ropensci.org/landscapetools

License: GNU General Public License v3.0

R 95.62% C 4.38%
r rstats raster landscape landscape-ecology visualization workflow r-package

landscapetools's Introduction

R-CMD-check codecov lifecycle CRAN status DOI:10.1111/2041-210X.13076

landscapetools

landscapetools provides utility functions for some of the less-glamorous tasks involved in landscape analysis:

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.
  • util_writeESRI: Export raster objects as ESRI asciis (with Windows linebreaks).

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.
  • show_shareplot: Plot the landscape share in subsequential buffers around a/multiple point(s) of interest

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 released version from CRAN with:

install.packages("landscapetools")

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("ropensci/landscapetools")

Utilities

Classify

# Classify the landscape into land uses
classified_landscape <- util_classify(fractal_landscape,
                                      n = 3,
                                      level_names = c("Land Use 1", 
                                                      "Land Use 2",
                                                      "Land Use 3"))

show_landscape(classified_landscape, discrete = TRUE)

Merge

# Merge all landscapes into one
merged_landscape <- util_merge(fractal_landscape,
                               c(gradient_landscape, random_landscape),
                               scalingfactor = 1)

# Plot an overview
merge_vis <- list(
    "1) Primary" = fractal_landscape,
    "2) Secondary 1" = gradient_landscape,
    "3) Secondary 2" = random_landscape,
    "4) Result" = merged_landscape
)

show_landscape(merge_vis)
#> Warning: Removed 1196 rows containing missing values (geom_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

  • Please report any issues or bugs.
  • License: GPL3
  • Get citation information for landscapetools in R doing citation(package = 'landscapetools')
  • We are very open to contributions - if you are interested check Contributing.
    • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

ropensci_footer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.