knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of segregr is to provide and easy way of calculating spatial segregation metrics in R.
You can install the development version of segregr from GitHub with:
# install.packages("devtools") devtools::install_github("mvpsaraiva/segregr")
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.