Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spatlyu/tidyrgeoda
A tidy interface for rgeoda
https://github.com/spatlyu/tidyrgeoda
geocomputation geoinformatics giscience r spatial-analysis spatial-statistics
Last synced: about 1 month ago
JSON representation
A tidy interface for rgeoda
- Host: GitHub
- URL: https://github.com/spatlyu/tidyrgeoda
- Owner: SpatLyu
- Created: 2024-05-25T05:17:18.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-08-17T01:34:33.000Z (4 months ago)
- Last Synced: 2024-08-17T02:38:33.696Z (4 months ago)
- Topics: geocomputation, geoinformatics, giscience, r, spatial-analysis, spatial-statistics
- Language: R
- Homepage: https://spatlyu.github.io/tidyrgeoda/
- Size: 6.66 MB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "##",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# tidyrgeoda
![CRAN](https://www.r-pkg.org/badges/version/tidyrgeoda)
![r-universe](https://spatlyu.r-universe.dev/badges/tidyrgeoda)The goal of **tidyrgeoda** is to provide an interface for **rgeoda** to integrate with **sf** objects and the **tidyverse**.
## Installation
You can install the development version of **tidyrgeoda** from [github](https://github.com/SpatLyu/tidyrgeoda):
``` r
# install.packages("devtools")
devtools::install_github("SpatLyu/tidyrgeoda",
build_vignettes = T,
dep = T)
```or install **tidyrgeoda** from [r-universe](https://spatlyu.r-universe.dev/tidyrgeoda):
```r
install.packages('tidyrgeoda',
repos = c("https://spatlyu.r-universe.dev",
"https://cran.rstudio.com/"),
dep = TRUE)
```## Example
This is a basic example which shows you how to use `tidyrgeoda` to create a `spatial weight matrix` and calculate the `local_moran`:
```{r example}
library(sf)
library(tidyverse)
library(tidyrgeoda)guerry = read_sf(system.file("extdata","Guerry.shp",package = "rgeoda"))
guerry %>%
mutate(lisa = st_local_moran(.,'Crm_prs',
wt = st_weights(.,'contiguity',queen = T))) %>%
select(lisa) -> g_lisa
g_lisaggplot(data = g_lisa) +
geom_sf(aes(fill = lisa),lwd = .1,color = 'grey') +
scale_fill_lisa()
```