An R package with various functions to study neighborhood dynamics.
devtools::install_github("timathomas/neighborhood", ref = "main")
The Neighborhood Racial Typologies function is a descriptive, categorical tool to help identify racial and ethnic divides within a region (e.g. city, county, state, etc.). Traditional segregation measures, such as the disimilarity index, provide a single measure for a large geographical area. This descripitve function is useful for mapping tract level, small area (e.g. neighborhood level) divisions between ethnic and racial groups.
This function is based off this paper:
Hall, Matthew, Kyle Crowder, and Amy Spring. 2015. “Neighborhood Foreclosures, Racial/Ethnic Transitions, and Residential Segregation.” American Sociological Review 80:526–549.
nt
: Neighborhood Racial Typologiesntdf
: create the dataframe for ntntcheck
: identify counts that can be concatenated
You can view an interactive map using this function here.
Baltimore_nt <- ntdf(state = "MD", county = "Baltimore City", geometry = TRUE)
cal <- ntdf(state = "CA")
ny <- ntdf(state = "NY")
glimpse(Baltimore_nt)
ps_nt <- ntdf(state = "WA", county = c("Snohomish", "King", "Pierce"), geometry = TRUE)
# Check to see if there are duplicate tract assumptions.
Baltimore_nt %>%
st_set_geometry(NULL) %>%
mutate(val = 1) %>%
spread(NeighType, val, fill = 0) %>%
mutate_at(vars(`All Black`:`White-Shared`), list(as.numeric)) %>%
select(13:ncol(.)) %>%
mutate(rowsum = rowSums(.)) %>%
filter(rowsum > 1) %>%
glimpse()
After running the above code, look at the counts and consider concatenating and/or reducing outlying (small count) neighborhood types.
ntcheck(Baltimore_nt)
ntcheck(cal)
ntcheck(ny)
ntcheck(ps_nt)
The nt_conc
field concatenates the NeighType
field automatically and may satisfy most people.