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

segregr

The goal of segregr is to provide and easy way of calculating spatial segregation metrics in R.

Installation

You can install the development version of segregr from GitHub with:

# install.packages("devtools")
devtools::install_github("mvpsaraiva/segregr")

Example

This is a basic example which shows you how to solve a common problem:

library(sf)
library(segregr)

# load sample data from package segregr
marilia_sf <- st_read(system.file("extdata/marilia_2010.gpkg", package = "segregr"))

# calculate segregation metrics
segregation <- measure_segregation(marilia_sf)
# global dissimilarity index
segregation$D

#' # global entropy
segregation$E

# global information theory index H
segregation$H


mvpsaraiva/segregr documentation built on July 16, 2021, 3:07 p.m.