spatialising

Perform simulations of binary spatial raster data using the Ising model

https://github.com/nowosad/spatialising

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.1%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Perform simulations of binary spatial raster data using the Ising model

Basic Info
Statistics
  • Stars: 6
  • Watchers: 1
  • Forks: 0
  • Open Issues: 1
  • Releases: 1
Created over 4 years ago · Last pushed 12 months ago
Metadata Files
Readme License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# spatialising


[![R-CMD-check](https://github.com/Nowosad/spatialising/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Nowosad/spatialising/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/spatialising)](https://CRAN.R-project.org/package=spatialising)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![Codecov test coverage](https://codecov.io/gh/Nowosad/spatialising/branch/main/graph/badge.svg)](https://app.codecov.io/gh/Nowosad/spatialising?branch=main)


The goal of **spatialising** is to perform simulations of binary spatial raster data using the Ising model.

## Installation

You can install the released version of **spatialising** from CRAN with:

``` r
install.packages("spatialising")
```

You can install the development version of **spatialising** from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("Nowosad/spatialising")
```

## Example

```{r, echo=FALSE}
set.seed(2022-04-06)
```

The **spatialising** package expects raster data with just two values, `-1` and `1`.
Here, we will use the `r_start.tif` file built in the package.

```{r, fig.height=3, message=FALSE}
library(spatialising)
library(terra)
r1 = rast(system.file("raster/r_start.tif", package = "spatialising"))
plot(r1)
```

Most of the raster area is covered with the value of `1`, and just about 5% of the area is covered with the value of `-1`.
The main function in this package is `kinetic_ising()`.
It accepts the input raster and at least two additional parameters: `B` -- representing external pressure and `J` -- representing the strength of the local autocorrelation tendency.
The output is a raster modified based on the provided parameters.

```{r, fig.height=3}
r2 = kinetic_ising(r1, B = -0.3, J = 0.7)
plot(r2)
```

The `kinetic_ising()` function also has a fourth argument called `updates`. 
By default, it equals to `1`, returning just one raster as the output.
However, when given a value larger than one, it returns many rasters.
Each new raster is the next iteration of the Ising model of the previous one.

```{r, fig.asp=0.3}
ri1 = kinetic_ising(r1, B = -0.3, J = 0.7, updates = 3)
plot(ri1, nr = 1)
```

Obtained results depend greatly on the set values of `B` and `J`.
In the example above, values of `B = -0.3` and `J = 0.7` resulted in expansion of the yellow category (more `-1` values).

On the other hand, values of `B = 0.3` and `J = 0.7` give a somewhat opposite result with less cell with the yellow category:

```{r, fig.asp=0.3}
ri2 = kinetic_ising(r1, B = 0.3, J = 0.7, updates = 3)
plot(ri2, nr = 1)
```

Finally, in the last example, we set values of `B = -0.3` and `J = 0.4`.
Note that the result shows much more prominent data change, with a predominance of the yellow category only after a few updates.

```{r, fig.asp=0.3}
ri3 = kinetic_ising(r1, B = -0.3, J = 0.4, updates = 3)
plot(ri3, nr = 1)
```

## Documentation

Read the related article:

1. Stepinski, T. F. & Nowosad, J. (2023). The kinetic Ising model encapsulates essential dynamics of land pattern change, Royal Society Open Science, https://doi.org/10.1098/rsos.231005

## Contribution

Contributions to this package are welcome - let us know if you have any suggestions or spotted a bug. 
The preferred method of contribution is through a GitHub pull request. 
Feel also free to contact us by creating [an issue](https://github.com/nowosad/spatialising/issues).

Owner

  • Name: Jakub Nowosad
  • Login: Nowosad
  • Kind: user
  • Location: Poznań, Poland

Geocomputation, Pattern Analysis, Spatial Data Mining, Geostatistics, and R.

GitHub Events

Total
  • Watch event: 1
  • Push event: 2
Last Year
  • Watch event: 1
  • Push event: 2

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 81
  • Total Committers: 1
  • Avg Commits per committer: 81.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Jakub Nowosad t****i@g****m 81

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 8
  • Total pull requests: 11
  • Average time to close issues: 3 months
  • Average time to close pull requests: less than a minute
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.13
  • Average comments per pull request: 0.0
  • Merged pull requests: 11
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Nowosad (6)
Pull Request Authors
  • Nowosad (4)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 177 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: spatialising

Ising Model for Spatial Data

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 177 Last month
Rankings
Dependent packages count: 28.7%
Dependent repos count: 36.8%
Average: 50.5%
Downloads: 86.1%
Maintainers (1)
Last synced: 11 months ago