Description Usage Arguments Value Examples
Convert local results of information theory index H to SF
1 |
segregation_results |
a segreg object containing the results of a call to measure_segregation(). |
a spatial sf object with local index H results
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | library("sf")
library("ggplot2")
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)
# export local index h results
index_h <- h_to_sf(segregation)
# plot local index h
ggplot(data = index_h) +
geom_sf(aes(fill = h)) +
scale_fill_distiller(palette = "Spectral")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.