项目作者: Nowosad

项目描述 :
Create co-occurrence matrices based on spatial data
高级语言: HTML
项目地址: git://github.com/Nowosad/comat.git
创建时间: 2019-07-16T14:50:02Z
项目社区:https://github.com/Nowosad/comat

开源协议:Other

下载


comat

Codecov test
coverage
CRAN
status
CRAN RStudio mirror
downloads

The goal of comat is to create co-occurrence matrices based on
spatial data, including a weighted co-occurrence matrix (wecoma) and
an integrated co-occurrence matrix (incoma).

Installation

You can install the released version of comat from
CRAN with:

  1. install.packages("comat")

You can install the development version from
GitHub with:

  1. # install.packages("remotes")
  2. remotes::install_github("Nowosad/comat")

Example

This is a basic example which shows you how to create a weighted
co-occurrence matrix (wecoma) based on two simple rasters (for
simplicity presented as matrices). The first one raster_x represents
some categories, and the second one raster_w represents weights.

  1. library(comat)
  2. library(raster)
  3. #> Loading required package: sp
  4. data(raster_x, package = "comat")
  5. data(raster_w, package = "comat")
  6. raster_x
  7. #> [,1] [,2] [,3]
  8. #> [1,] 1 1 3
  9. #> [2,] 1 3 3
  10. #> [3,] 2 2 3
  11. raster_w
  12. #> [,1] [,2] [,3]
  13. #> [1,] 2 2 9
  14. #> [2,] 6 4 9
  15. #> [3,] 4 8 9

The get_wecoma() function can be next used to create a weighted
co-occurrence matrix.

  1. get_wecoma(
  2. raster_x,
  3. raster_w,
  4. neighbourhood = 4
  5. )
  6. #> 1 2 3
  7. #> 1 12.0 5.0 13.5
  8. #> 2 5.0 12.0 14.5
  9. #> 3 13.5 14.5 49.0

This function allows for some parametrization using additional
arguments, e.g.:

  1. get_wecoma(
  2. raster_x,
  3. raster_w,
  4. neighbourhood = 4,
  5. fun = "focal",
  6. na_action = "keep"
  7. )
  8. #> 1 2 3
  9. #> 1 12 6 10
  10. #> 2 4 12 16
  11. #> 3 17 13 49

Documentation

For more examples see the package’s vignettes:

  1. A co-occurrence matrix (coma)
    representation
  2. A weighted co-occurrence matrix (wecoma)
    representation
  3. An integrated co-occurrence matrix (incoma)
    representation

Contribution

Contributions to this package are welcome. The preferred method of
contribution is through a GitHub pull request. Feel free to contact me
by creating an issue.

Citation

To cite the comat package in publications, please use this
paper
:

Nowosad J, Stepinski TF (2021) Pattern-based identification and mapping
of landscape types using multi-thematic data, International Journal of
Geographical Information Science, DOI: 10.1080/13658816.2021.1893324

LaTeX/BibTeX version can be obtained with:

  1. library(comat)
  2. citation("comat")