isolation_to_sf: Convert local isolation results to SF

Description Usage Arguments Value Examples

View source: R/isolation_to_sf.R

Description

Convert local isolation results to SF

Usage

1
isolation_to_sf(segregation_results)

Arguments

segregation_results

a segreg object containing the results of a call to measure_segregation().

Value

a spatial sf object with local isolation results

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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 isolation results
isolation <- isolation_to_sf(segregation)

# plot local isolation
ggplot(data = isolation) +
  geom_sf(aes(fill = isolation)) +
  scale_fill_distiller(palette = "Spectral") +
  facet_wrap(~group) +
  theme_void()

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