{"id":19508158,"url":"https://github.com/r-spatialecology/belg","last_synced_at":"2025-04-26T02:33:53.864Z","repository":{"id":56934511,"uuid":"122247898","full_name":"r-spatialecology/belg","owner":"r-spatialecology","description":"Boltzmann entropy of a landscape gradient","archived":false,"fork":false,"pushed_at":"2022-12-15T15:22:43.000Z","size":4421,"stargazers_count":16,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-11T16:07:34.949Z","etag":null,"topics":["entropy","landscape","r","raster","spatial"],"latest_commit_sha":null,"homepage":"https://r-spatialecology.github.io/belg/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-spatialecology.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-20T19:50:56.000Z","updated_at":"2023-05-04T09:35:49.000Z","dependencies_parsed_at":"2023-01-29T03:30:58.062Z","dependency_job_id":null,"html_url":"https://github.com/r-spatialecology/belg","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-spatialecology%2Fbelg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-spatialecology%2Fbelg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-spatialecology%2Fbelg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-spatialecology%2Fbelg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-spatialecology","download_url":"https://codeload.github.com/r-spatialecology/belg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250922201,"owners_count":21508290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["entropy","landscape","r","raster","spatial"],"created_at":"2024-11-10T23:04:02.483Z","updated_at":"2025-04-26T02:33:53.508Z","avatar_url":"https://github.com/r-spatialecology.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n# belg\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](http://www.r-pkg.org/badges/version/belg)](https://cran.r-project.org/package=belg)\n[![R build status](https://github.com/r-spatialecology/belg/workflows/pkgdown-and-test-coverage/badge.svg)](https://github.com/r-spatialecology/belg/actions)\n[![codecov](https://app.codecov.io/gh/r-spatialecology/belg/branch/master/graph/badge.svg)](https://app.codecov.io/gh/r-spatialecology/belg)\n[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/belg)](https://cran.r-project.org/package=belg)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1209419.svg)](https://doi.org/10.5281/zenodo.1209419)\n\u003c!-- badges: end --\u003e\n  \nBoltzmann entropy (also called configurational entropy) has been recently adopted to analyze entropy of landscape gradients (Gao et al. (2017, 2018, 2019)).\nThe goal of **belg** is to provide an efficient C++ implementation of this method in R.\nIt also extend the original idea by allowing calculations on data with missing values (Nowosad and Gao (2020)).\n\n## Installation\n\nYou can install the released version of belg from [CRAN](https://CRAN.R-project.org) with:\n\n``` r\ninstall.packages(\"belg\")\n```\n\nAnd the development version from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"r-spatialecology/belg\")\n```\n\n## Examples\n\nAs an example, we use two rasters - `land_gradient1` representing a complex landscape and `land_gradient2` representing a simple landscape:\n\n```{r, message=FALSE, fig.height=3}\nlibrary(raster)\nlibrary(belg)\nland_gradient1 = raster(system.file(\"raster/land_gradient1.tif\", package = \"belg\"))\nland_gradient2 = raster(system.file(\"raster/land_gradient2.tif\", package = \"belg\"))\nplot(stack(land_gradient1, land_gradient2))\n```\n\nThe main function in this package, `get_boltzmann()`, calculates the Boltzmann entropy of a landscape gradient:\n\n```{r}\nget_boltzmann(land_gradient1)\nget_boltzmann(land_gradient2)\n```\n\nThis function accepts a `SpatRaster`, `stars`, `RasterLayer`, `RasterStack`, `RasterBrick`, `matrix`, or `array` object as an input.\nIt allows for calculation of the relative (the `relative` argument equal to `TRUE`) and absolute Boltzmann entropy of a landscape gradient.\nAs a default, it uses a logarithm of base 10 (`log10`), however `log` and `log2` are also available options for the `base` argument.\n\n```{r}\nget_boltzmann(land_gradient1, base = \"log\")\nget_boltzmann(land_gradient1, relative = TRUE)\nget_boltzmann(land_gradient1, base = \"log2\", relative = TRUE)\n```\n\nTwo methods of calculating the Boltzmann entropy of a landscape gradient are available: `\"hierarchy\"` (default) for the hierarchy-based method (Gao et al., 2017) or `\"aggregation\"` for the aggregation-based method (Gao et al., 2019).\nThe aggregation-based method requires that the number of rows and columns in the input data must be a multiple of 2.\n\n```{r}\nget_boltzmann(land_gradient1, method = \"aggregation\")\nget_boltzmann(land_gradient1, relative = TRUE, method = \"aggregation\")\n```\n\nMore examples can be find at https://github.com/Nowosad/belg-examples.\n\n## References\n\n- Gao, Peichao, Hong Zhang, and Zhilin Li. \"A hierarchy-based solution to calculate the configurational entropy of landscape gradients.\" Landscape Ecology 32(6) (2017): 1133-1146.\n- Gao, Peichao, Hong Zhang, and Zhilin Li. \"An efficient analytical method for computing the Boltzmann entropy of a landscape gradient.\" Transactions in GIS (2018).\n- Gao, Peichao and Zhilin Li. \"Aggregation-based method for computing absolute Boltzmann entropy of landscape gradient with full thermodynamic consistency.\" Landscape Ecology (2019).\n- Nowosad, J.; Gao, P. belg: A Tool for Calculating Boltzmann Entropy of Landscape Gradients. Entropy 2020, 22, 937. https://doi.org/10.3390/e22090937\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-spatialecology%2Fbelg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-spatialecology%2Fbelg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-spatialecology%2Fbelg/lists"}